The “100” is the range, and in range it goes from 0 – 100, unless the first number isn’t specified.
10 in this case is the amount of numbers that will be generated
import random random.sample(range(100), 10) # Output [0,1,2,3,4,5,6,7,8,9]
Here’s the StackOverflow article:
Have any questions or comments? Write them below!
Leave a Reply