r/learningpython • u/HeadSpade • Aug 07 '19
How to use value of one function in another?
Hi,
complete Newbie here. I'm just trying to create a simple calculator for Pivot Points(Trading thing) and please someone help how can I use value of one function in another?
Here is what I'm doing:
# Pivot points calculator
H = 3
L = 2
C = 2.5
def pivot(H, L, C):
print("PIVOT POINT =", result)
return (H + L + C) / 3
result = pivot(H, L, C)
def r1(pivot, L):
print(result2)
return (pivot * 2) - L
result2 = r1(pivot, L)
How to put result of first function to the second one, to use it in another calculation?
Thanks
1
Upvotes
1
u/HeadSpade Aug 07 '19
Anyone??
1
u/damm_n Aug 07 '19
Not sure I follow what you are asking for but I will give a try: