dimanche 25 octobre 2020

random list within a certain limit

i want to generate a random list, in which generates n numbers between a and b. However, when executing, nothing comes out.

def random_list(a,b,n):
    import random
    xs=[]
    x=random.randint(a,b)
    xs.append(x)
    while len(xs)==n:
        return xs



Aucun commentaire:

Enregistrer un commentaire