Python是简单地造就另一个提示,当我从Zed的肖锻炼18为什么这个def函数没有在Python中执行?
# this one is like our scripts with argv
def print_two(*args):
arg1, arg2 = args
print "arg1: %r, arg2: %r" % (arg1, arg2)
# ok, that *args is actually pointless, we can just do this
def print_two_again(arg1, arg2) :
print "arg1: %r, arg2: %r" % (arg1, arg2)
# this just takes one argument
def print_one(arg1) :
print "arg1: %r" % arg1
# this one takes no argument
def print_none() :
print "I got nothin'."
print_two("Zed","Shaw")
print_two_again("Zed","Shaw")
print_one("First!")
print_none()
对不起,*其中*一段代码?你在Python REPL中输入了所有的东西吗? – 2011-03-23 03:12:30
哪段代码? – 2011-03-23 03:12:55
@senderle对此表示歉意!感谢您的支持! – 2011-04-13 03:00:13