scope of variables

Rob E remm1 at member.fsf.org
Wed May 3 20:18:58 EDT 2006


> is the code below correct?
> 
> b = 3
> def adding(a)
>     print a + b
> 
> it seams not to see the up-level scope where b is defined.

Yes except for the missing : at the end of the "def" line.

Rob




More information about the Python-list mailing list