On Fri, 03 Aug 2012 04:49:46 -0700, Subhabrata wrote:

> I am trying to call the values of one function in the another function
> in the following way:
> def func1():
>       num1=10
>       num2=20
>       print "The Second Number is:",num2
>       return
> 
> def func2():
>       num3=num1+num2
>       num4=num3+num1

A function's local variables only exist while that function is being
executed[1]. It's meaningless to try to access them from outside the
function.

[1] There is an exception (closures), but it doesn't have any bearing on
this particular problem.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to