samedi 4 août 2018

How can i create a random number generator in python that doesn't create duplicate numbers

I have a simple python code to create random numbers, here it is

import random
for x in range(100):
    print (random.randint(1,100))

even though this code creates random numbers it can still create duplicates, can anyone help me out with an idea to make it not be able to print duplicates?




Aucun commentaire:

Enregistrer un commentaire