Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Python overtakes Java to become second-most popular language on GitHub. Parent comment
Ok. I'll bite.
I get UnboundLocalError: local variable 'a' referenced before assignment
shouldn't it print 0 twice, since a is considered a global variable at the time print(a) gets called?
EDIT: If I delete print(a), then it prints 0 twice. What the hell?
There are no comments on this comment yet.
Ok. I'll bite.
I get UnboundLocalError: local variable 'a' referenced before assignment
shouldn't it print 0 twice, since a is considered a global variable at the time print(a) gets called?
EDIT: If I delete print(a), then it prints 0 twice. What the hell?