mercredi 28 août 2019

Generate 2 random integer list of different size

I am trying to generate 2 list with different size consisting with random numbers. I can generate 2 list with random numbers, but how to achieve 2 different length of lists?

import random
list1 = random.sample(xrange(100), 10)
list2 = random.sample(xrange(100), 10)
print(list1)
print(list2)

Need to generate the lists with 2 random different sizes as well, as if both the lists are completely random.




Aucun commentaire:

Enregistrer un commentaire