How print statement create a local variables

后端 未结 3 437
心在旅途
心在旅途 2020-12-14 17:08

Question are at the end of this post.

First snippet: empty local variable dictionary.

def outer():
    x = 1
    def inner():
               


        
3条回答
  •  温柔的废话
    2020-12-14 18:01

    there is an explanation Why am I getting an UnboundLocalError when the variable has a value? on the python docs faq page, similar to the above answers by abarnert and Martijn.

提交回复
热议问题