Variables have a certain reach within a program. A global variable can be used anywhere in a program, but a local variable is known only in a certain area (function, loop)
balance = 0
balance = balance + x
In the program above, balance is a global variable. It can be used anywhere in the code. But the variable x can only be used inside addAmount.
Try the exercises below:
1. Add a function reduce amount that changes the variable balance
After completing these continue with the next exercise.