A syntax question
Wolfgang Maier
wolfgang.maier at biologie.uni-freiburg.de
Mon Nov 10 06:39:17 EST 2014
More information about the Python-list mailing list
Mon Nov 10 06:39:17 EST 2014
- Previous message (by thread): A syntax question
- Next message (by thread): A syntax question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
You may want to read: https://docs.python.org/3/faq/programming.html?highlight=global#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value from the Python docs Programming FAQ section. It explains your problem pretty well. As others have hinted at, always provide concrete Python error messages and tracebacks instead of vague descriptions. Best, Wolfgang On 11/10/2014 12:07 PM, Mok-Kong Shen wrote: > > I don't understand the following phenomenon. Could someone kindly > explain it? Thanks in advance. > > M. K. Shen > > ------------------------------------------------- > > count=5 > > def test(): > print(count) > if count==5: > count+=0 ### Error message if this line is active, otherwise ok. > print(count) > return > > test()
- Previous message (by thread): A syntax question
- Next message (by thread): A syntax question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list