#test the default args
def test2args(arg1="default1", arg2="default2"):
print "arg1: " + arg1
print "arg2: " + arg2
def test2argskwargs(arg1="default1", arg2="default2", **kwargs):
print "arg1: " + arg1
print "arg2: " + arg2
for k, v in kwargs:
print "%s=%s" % (k, v)
test2args()
test2args("1","2")
args = ("3","4")
test2args(*args)
#test2args(a="5", b="6")
test2argskwargs("3","4", a="5", b="6")
Thursday, March 11, 2010
March Madness Challenge - Day 11
Hello kwargs
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment