How can I use a variable that we defined inside the function inside another function?
For Exemple:
def fx():
x = 5
return x + 5
def fy():
return x + 10
fx()
fy()
"""
the output i wanted : 15
"""
How can I use a variable that we defined inside the function inside another function?
For Exemple:
def fx():
x = 5
return x + 5
def fy():
return x + 10
fx()
fy()
"""
the output i wanted : 15
"""
The solution @Kraigolas mentioned implemented
def fx():
x = 5
return x
def fy(x):
print(x)
fy(fx())