scope of variables

Rob E remm1 at member.fsf.org
Thu May 4 02:18:58 CEST 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