def sample_with_replacement(population, k):
 return [random.choice(population) for i in range(k)]

def sample_with_replacement ( population , k ) : return [ random . choice ( population ) for i in range ( k ) ]
returns a sample of size k from the given population .