ã¡ã¢ä»£ãããã¦ãã¨ã¼ã«ã ãããã§ãããã¦ãã¨ã¼ã§ãã£ã¦ã 2å¹´åãããã«Pythonãããã§ã¡ã¼ã«ãããæ¹ãããããªãããã¡ã¼ã«ç´å¤±ãã¦ãã¾ãç¡è¦ããå½¢ã«ãªã£ã¦ãã¾ãã¾ããããã ããã¾ã§ã¯ãã¼ã«ã«ã¹ã³ã¼ãã«å±ãããã©ãã㯠ãä»£å ¥ãããæç¹ã§æ±ºå®ãã ã¨ã®ãã¨ã ã£ãããå®éã¯éãã¨ã®ãã¨ã ã¾ãä¾ãè¦ãã >>> x = 100 >>> def aaa(): ... print x ... x = 99 ... >>> aaa() Traceback (most recent call last): File "", line 1, in ? File "", line 2, in aaa UnboundLocalError: local variable 'x' referenced before assignment >>> aaaé¢æ°ã®ä¸ã§2åã°ãã¼ãã«å¤æ°ã¨åãååã®å¤æ°ã使ã
{{#tags}}- {{label}}
{{/tags}}