Arbitrary Thoughts On Arbitrary Parameters Functions
versus λ-f()
4 min readMay 3, 2024
I came across a specific tasks that they have to be repeated with different values.
def do_function_N_times(n, function_arbitary):
"""
Call function_arbitary n times and return output of the n times.
"""
return [function_arbitary() for _ in range(n)]
# Example usage
import random
number_of_values_to_produce =…