I know this has been explained here before, but I still cannot figure it out for my scenario, which I explain as simple as this:
def func1 ():
a = 1
b = 2
print a + b
def func2 ():
c = 3
d = 4
e = a * c
f = b + d
func1()
func2()
When run like this:
$ ./test1.py
3
Traceback (most recent call last):
File "./test1.py", line 18, in <module>
func2()
File "./test1.py", line 14, in func2
e = a * c
NameError: global name 'a' is not defined
Simple question is, how to change above code so func2 stores variables from func1?