相关疑难解决方法(0)

如何在Python中将变量用作函数名

是否可以在python中使用变量作为函数名?例如:

list = [one, two, three]
for item in list:
    def item():
         some_stuff()
Run Code Online (Sandbox Code Playgroud)

python python-3.x

9
推荐指数
5
解决办法
2万
查看次数

标签 统计

python ×1

python-3.x ×1