【发布时间】:2014-11-14 04:16:49
【问题描述】:
我有多个函数将使用相同的参数。是否可以只将参数存储到变量中,以便我可以将变量传递给多个函数?
例子:
#Store the arguments into a variable:
Arguments = (pos_hint={'center_x': 0.5, 'center_y': 0.5},
size_hint=(1, 1), duration=2) #possible?
function1(Arguments) #Then pass variable to first function
function2(Arguments) #Then pass variable to different function
function3(Arguments) #etc.
...
【问题讨论】:
标签: python function python-2.7 arguments