00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 def foo1(a=42, b=6, c=7):
00019 return (a, b, c)
00020
00021 print "foo1()=", foo1()
00022 assert foo1() == (42, 6, 7)
00023 assert foo1("forty two") == ("forty two", 6, 7)
00024 assert foo1("forty two", 9) == ("forty two", 9, 7)
00025 assert foo1("forty two", 9, ("test",)) == ("forty two", 9, ("test",))
00026
00027
00028
00029 def foo2(a, b=6, c=7):
00030 return (a, b, c)
00031
00032 print "foo2(42)=", foo2(42)
00033
00034 assert foo2("forty two") == ("forty two", 6, 7)
00035 assert foo2("forty two", 9) == ("forty two", 9, 7)
00036 assert foo2("forty two", 9, ("test",)) == ("forty two", 9, ("test",))
00037
00038
00039
00040 def foo3(a, b, c=7):
00041 return (a, b, c)
00042
00043 print "foo3(42, 6)=", foo2(42, 6)
00044
00045 assert foo3("forty two", 6) == ("forty two", 6, 7)
00046 assert foo3("forty two", 6, 9) == ("forty two", 6, 9)
00047 assert foo3("forty two", 6, ("test",)) == ("forty two", 6, ("test",))
00048