vandermies vandermies - 11 months ago 58
Python Question

Generate X random integers between Y and Z?

Is there a function in Python (I'm working with SageMath) to get 10 random integers between 0 and 30, for instance, without repeating them?

Answer Source
import random
random.sample(range(31), 10)