1import random
2cakes = ['lemon', 'strawberry', 'chocolate']
3random.choice(cakes)
4# prints 1 randomly selected item from the collection of n items with
5# the probability of selection as 1/n
1import random
2sequence = [i for i in range(20)]
3subset = sample(sequence, 5) #5 is the lenth of the sample
4print(subset) # prints 5 random numbers from sequence (without replacement)