I have the following 2 functions:
a = 20
b = 45
def function1():
coin = np.random.randint(0, 100)
a2= a+coin
return a2
def function2():
b2= b+coin
return b2
However, my problem here is as follows: I want to use the randomly selected 'coin' value (determined in function 1) inside function 2.
The condition here is that the random selection must always be done in function 1. What is the most efficient way to pass this coin value to function 2 without having to call function 1 inside function 2?
NOTE: function 1 should only return one variable which is a2.
cointo change eveytime function 1 is called