Re: [Tutor] learning nested functions

2013-07-10 Thread Alan Gauld
On 08/07/13 07:26, Tim Hanson wrote: In the first Lutz book, I am learning about nested functions. def f1(): x=88 def f2(): print(x) x=99 print(x) f2() f1() Traceback (most recent call last): print(x) Un

Re: [Tutor] learning nested functions

2013-07-10 Thread Dave Angel
On 07/08/2013 02:26 AM, Tim Hanson wrote: In the first Lutz book, I am learning about nested functions. Here's the book's example demonstrating global scope: def f1(): x=88 def f2(): print(x) f2() f1() 88 But that's not global scope, it's

Re: [Tutor] learning nested functions

2013-07-10 Thread Hugo Arts
On Mon, Jul 8, 2013 at 8:26 AM, Tim Hanson wrote: > In the first Lutz book, I am learning about nested functions. > > Here's the book's example demonstrating global scope: > >>> def f1(): > x=88 > def f2(): > print(x) > f2() > > > >>> f1() > 88 > > No prob