Yes, I've read tons of examples on this but I still don't get it.
I'm learning Python and I made this script in order to help me understand how to 'return':
def random_number():
random = 0
random = (random + 5) * 10
return random
def calc_pay_rise():
payrise = 5
random_number()
payrise = payrise + random
print payrise
calc_pay_rise()
I expect the output of 55. Instead I get the error: 'global name 'random' is not defined'. I think I defined what random is in the random_number() function though.
Is there a way to pass the value of random to the function calc_pay_rise()?