Feb-20-2018, 07:08 PM
when pasting in the interactive interrupter, you must do it line by line, making sure
lines are indented properly. works just fine if you do this:
lines are indented properly. works just fine if you do this:
>>> numcalls = 0 >>> def square(x): ... global numcalls ... numcalls = numcalls + 1 ... return x * x ... >>> d = square(5) >>> d 25 >>>