2014-03-03 18:25:08 -05:00
|
|
|
# overriding default arguments
|
|
|
|
|
|
|
|
def foo(a, b=3):
|
|
|
|
print(a, b)
|
|
|
|
|
|
|
|
# override with positional
|
|
|
|
foo(1, 333)
|
|
|
|
|
|
|
|
# override with keyword
|
|
|
|
foo(1, b=333)
|
|
|
|
|
|
|
|
# override with keyword
|
|
|
|
foo(a=2, b=333)
|
2014-04-09 22:39:38 -04:00
|
|
|
|
|
|
|
def foo2(a=1, b=2):
|
|
|
|
print(a, b)
|
|
|
|
|
|
|
|
# default and keyword
|
|
|
|
foo2(b='two')
|