Q:

Python definition function parameter passing

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.

A:

I think the best solution would be adopting an OO paradigm for your code (classes, methods and inheritance).
Using simple functions, you can just choose between using global variables and local scoped.

A:

If I understand what do you need then I think simplest way that python brings you is next ->
class Helper:pass 

# use name space
def one(a):  
    a.x=1
    a.y=2
    a.z=3
    a.h=33
    a.j=454
    a.l=353
    a.m=898

def two(a):
    a.y=7

a=Helper()

one(a)
print(a.x,a.y)
two(a)
print(a.x,a.y)

#-------------------------------------------------------------------
# I think you have solution and dont need to read next lines :)
# next lines are just bonus ;)
#-------------------------------------------------------------------

# you could use more independent "namespaces"
b=Helper()
one(b)
print(b.y)
print(a.y)  # "namespace a" is unchanged

# if you like to see which attributes are defined you could use funciton dir
# (under python3 it is a little more complicated)
print(dir(a))
print(dir(b))

# please dont do next lines at home!!! :P:P:P (__builtins__ is special you could get unwanted results!) 
one(__builtins__)

print(x) # 

