9/15/2018

python 1 line code for N random number (tip)

Make 1~100 random integer as 10 loops


import random
myr = [random.randrange(1, 100) for _ in range(10)]
print(myr)

result
[9, 67, 32, 55, 79, 47, 86, 62, 95, 30]

Thank you. ^^


No comments:

Post a Comment