On 2007-06-21, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> def f():
> a = 12
> def g():
> global a
> if a < 14:
> a=13
> g()
> return a
>
> print f()
>
> This function raises an error. Is there any way to access the a
> in f() from inside g().
>
> I co
[EMAIL PROTECTED] wrote:
> def f():
> a = 12
> def g():
> global a
> if a < 14:
> a=13
> g()
> return a
>
> print f()
>
> This function raises an error. Is there any way to access the a in f()
> from inside g().
>
> I could find few past discussions on
[EMAIL PROTECTED] wrote:
> def f():
> a = 12
> def g():
> global a
> if a < 14:
> a=13
> g()
> return a
>
> print f()
>
> This function raises an error. Is there any way to access the a in
> f() from inside g().
Yes. Pass it to g when calling the latt
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> def f():
> a = 12
> def g():
> global a
> if a < 14:
> a=13
> g()
> return a
>
> print f()
>
> This function raises an error. Is there any way to access the a in f()
> from inside g().
>
> I could find
def f():
a = 12
def g():
global a
if a < 14:
a=13
g()
return a
print f()
This function raises an error. Is there any way to access the a in f()
from inside g().
I could find few past discussions on this subject, I could not find
the simple answer wheth