I've been reading a book, and got stuck on the topic of optional arguments.
• Can define defaults for arguments that need not be passed
>>> def func(a, b, c=10, d=100):
print a, b, c, d
>>> func(1,2)
1 2 10 100
I don't get this ... how? Spent the hour googling and cannot understand it.
Reading this book and on that topic. I just do not get why func(1,2)
gives me 1,2,10,100
. I mean, how does it know?