bill.wu <bill.wws <at> gmail.com> writes:

> 
> 
>  
> i am new guy.
> i ask a easy question.
>  
> why the first one have"x",the second one doesn't have "x". what 
> is different? when write "x",when don't write "x".
>  
> in my point,the second one don't def variable.
>  
> 

Variable scope.  By declaring the x as "global", any changes to x in func() will
affect x outside the function, as well.


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to