I'm trying to figure out how to generate a random, non-repeating number. I thought about using randint
to create a number, put it in a list (repeat that for the number of place values I need), then put those lists into another list and use a while loop to check the list for repeats of the internal lists. If any occur the program just creates a new number for one of the internal lists that is repeated. Is there an easier/ less complex way of doing this?
samedi 1 octobre 2016
Generate random non-repeating numbers
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire