Can anyone tell me if this piece of code will produce only unique random numbers in a list :
random.sample(range(1, 100), 3)
random.sample(population, k)
Return a k length list of unique elements chosen from the population sequence. Used for random sampling without replacement.
To choose a sample from a range of integers, use an range() object as an argument
>>> import random
>>> print random.sample(range(1,100),3)
[77, 29, 45]
>>>