Mastering Development

Choosing a function randomly and calling it with the appropriate attributes in Python

The answers to Choosing a function randomly tell us how to pick and call a random function from a list using random.choice. But what if the functions in the list take different attributes? How do we call the function with the appropriate attributes? Example: from random import choice def fun_1(): … def fun_2(x: int): … […]