vendredi 21 octobre 2016

Simple LOTTERY Algorithm on PYTHON

İ want different numbers.I'm writing small number for example (10) in range it's working no problem but if i m writing a big number it can not work.

import random
arr=[]

for i in range(25):
    a=random.randint(1,30)
    if a in arr:
        b=random.randint(1,30)
        arr.append(b)
    if a not in arr:
        arr.append(a)
arr.sort()
print(arr[0:])




Aucun commentaire:

Enregistrer un commentaire