I have a function and it's getting a bit long, and so I am wanting to break it up into multiple functions. My problem is I am trying to get a number of values out of one function and into another and am not sure how to do it.
For example,say I was using these values (my program is much bigger)
def mean():
vitaminA = 5
calcium = 15
vitaminD = 22
how would I get each of these values into another function? I have tried:
def mean():
vitaminA = 5
calcium = 15
vitaminD = 22
return (vitaminA, calcium, vitaminD)
def stDev():
mean()
print vitaminA
print calcium
print vitaminD
What do I actually need to do? I thought if you return values from another function within a function you could access those values?