call list of function using list comprehension

前端 未结 4 709
无人共我
无人共我 2020-12-03 00:57

can I call a list of functions and use list comprehension?

def func1():return 1
def func2():return 2
def func3():return 3

fl = [func1,func2,func3]

fl[0]()         


        
4条回答
提交回复
热议问题