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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -