how do I call a list of functions and use a string list ? -
how call list of functions , use string list ?
def apple_w(): print(1) def banana_w(): print(2) def orange_w(): print(3) fruits = ['apple','banana','orange'] in fruits: .......
from syntax of code guess use python. there have globals
-function, returns dict global entities.
def apple_w(): print(1) def banana_w(): print(2) def orange_w(): print(3) fruits = ['apple','banana','orange'] in fruits: fn = globals()[i + '_w'] # function fn() # call function
Comments
Post a Comment