Pythonのお勉強 Part34
■ このスレッドは過去ログ倉庫に格納されています
0727デフォルトの名無しさん
2009/09/08(火) 15:53:18>>> def fa():
... a=3
... def fb():
... a+=5
... print a
... print a
... return fb
...
>>> b=fa()
3
>>> b()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 4, in fb
UnboundLocalError: local variable 'a' referenced before assignment
>>>
■ このスレッドは過去ログ倉庫に格納されています