mardi 14 avril 2020

How to generate random number in a loop without repeating in Python? [duplicate]

Now I'm using Python to build a loop:

for _ in range(9):
        random_number=random.randint(1,11)
        print(random_number)

My question is how to make sure each time the random_number is unique,not repeating in all 9 times.




Aucun commentaire:

Enregistrer un commentaire