take a random sample from a list in python code example Example: python choose sample from list with replacement import random random.choices(list, k = 4)