KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
why does this work: def function1(): a = 10 def function2(): print a function2() but this does not: def function1(): a = 10 def function2(): print a a -= 1 if a>0: function2() function2() I get this error: UnboundLocalError: local variable 'a' referenced before assignment
Tags (comma-separated)
Save Edits
Cancel