Thursday, March 17, 2016

interesting Python features: arguments

https://docs.python.org/2/tutorial/controlflow.html

Siri, remind me to explore this further.

i = 5

def f(arg=i):
    print arg

i = 6
f()

prints 5 instead of 6.

No comments: