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\':
Try this:
payrise = payrise + random_number()
When you call a function that returns a value (a random number in this case), you're supposed to do something with the returned value.
Also notice that the variable random
that was defined locally inside random_number()
can not be "seen" from other functions - unless you declare a new variable locally, but it can have any name you want. Another way to say the same would be:
random = random_number() # can be any name, I'm using `random` again
payrise = payrise + random