A ankurankan Original post #1 Aug 23, 2011 at 6:58 PM When I run the code: >>>i=5 >>>def f(arg=i): print(arg) >>>i=6 >>>f() It print 5.Why is this so??
Ishu Gupta #2 Aug 24, 2011 at 7:31 PM In the second line, its read as def f(arg=5):. If you use f(i), it'll print 6.