I want to generate 18000 numbers (integers) between 36499 and 130064, but two times, and insert them in two different lists. I want the numbers in each list to be unique, that is, different from each other in the list, and different from every number in the other list. So I've decided to use the random.sample method and so far i have
import random
random.seed(9000)
a = random.sample(range(36499, 130064), 18000)
All good so far. However if I do the same for, say, a list called "b", some numbers will exist in list "a" as well. Is this any way you guys can think of to generate 18000 numbers different from the ones already generated? Thanks
Aucun commentaire:
Enregistrer un commentaire