I'm trying to write a line of code that will allow me to create a random list of 5 values, whose lengths I can vary in size. For example, I want the numbers in the list to have a length of 2 or 3 integers, like this: [11, 34, 67, 88, 93] or [100, 450, 622, 875, 998].
So far I have this:
import random
mylist = []
for i in range(5):
p=p+[random.randrange(?????)
print(p)
Can anyone help me as I've been trying to do this all day and it's driving me crazy! Thanks.
Aucun commentaire:
Enregistrer un commentaire