0

is there a chance to repeat the item while I'm using random.sample

is there a chance to repeat the item while I'm using random.sample

9th Dec 2018, 6:38 PM
kokito
1 Respuesta
+ 1
From the Python Docs: random.sample(population, k) Return a k-length list of unique elements chosen from the population sequence or set. If the population contains repeats, then each ocurrence is a possible selection in the sample. https://docs.python.org/3/library/random.html#random.sample
9th Dec 2018, 6:52 PM
Diego
Diego - avatar