Python scope question

Grant Edwards grant.b.edwards at gmail.com
Tue Mar 12 10:47:49 EDT 2019


On 2019-03-12, Arup Rakshit <ar at zeit.io> wrote:

> I have questions how nonlocal and global affecting the variable
> assignment. Also how each print statement looking up the values for
> the spam variable. This scope thing in python is very confusing too
> me still. Can anyone help me to understand this code w.r.t to scope
> in Python?

https://www.ynonperek.com/2017/09/11/python-variable-scope-implicit-global-and-nonlocal/

-- 
Grant Edwards               grant.b.edwards        Yow! If I pull this SWITCH
                                  at               I'll be RITA HAYWORTH!!
                              gmail.com            Or a SCIENTOLOGIST!




More information about the Python-list mailing list