Store functions in list and call them later [duplicate]

Yes, you can do it. If you want to call all functions in the list with a “one liner” you can do the following:

results = [f() for f in options]

Leave a Comment