codehaus


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

local variable 'p' referenced before assignment


David <bouncingcats at gmail.com> writes:
>
https://docs.python.org/3/faq/programming.html#what-are-the-rules-for-local-and-global-variables-in-python 
>
> " If a variable is assigned a value anywhere within the function?s body,
> it?s assumed to be a local unless explicitly declared as global."
>

Coming with a baggage of other languages. :-) I should have searched
it. Thanks a lot for sharing this.

Regards.

-- 
Pankaj Jangid