mercredi 3 février 2021

Python - call sample of functions from list

How to call multiple random functions from a list? I've found a way to call one random function with this:

my_list = [f_1, f_2, f_3]

random.choice(my_list)()

I tried to modify it to work with sample instead of choice, but i can't make it work.




Aucun commentaire:

Enregistrer un commentaire