For most of you this is probably common sense but I am finding it very, very hard to get a handle on this. If you create a function such as
def one():
x=1
y=2
z=3
h=33
j=454
l=353
m=898
then lets say I have another function, def two():, and I want to use the variables in def one() into def two, and I also create two new variables in def two(). How would I go about doing that.
Then, lets say that I have a third function def three(), how would I use the variables in def 1 and def 2 into def 3? The methods I am using are very very inefficient and probably doing more than is required. What I do is in def two, a add all the variables from def one into def two's parameters, and then I also call function one in the def of function 2. I know there are numerous threads on this on SO, and I have looked through many of them and they don't simply it. They use very specific and advanced code that I am unfamiliar with and therefore don't understand. My example is very straightforward and simple and I'm sure if answered it will help many newcomers.Thanks!
EDIT:I don't want a "simple" way that ends up using advanced code I am not familiar with. I want an "efficient" method that is simple to understand.