【发布时间】:2014-06-24 08:41:58
【问题描述】:
如果这个问题已经得到解答,我深表歉意 - 我怀疑这很简单 - 但我不知道该怎么做。
演示我想做的事情更容易。
vflag=True
def printv(*prargs):
if vflag:
print prargs
# print *prargs gives a syntax error, unsurprisingly
printv("hello", "there", "world")
printv("hello", "again")
我希望输出是
hello there world
hello again
我得到(当然)
('hello', 'there', 'world')
('hello', 'again')
【问题讨论】:
标签: python function parameters python-2.x