Update the Amount
Currently, the amount stays the same for every step of the
for loop. So that’s what you will tackle next. Before your
print() function calls, add in a new line where you update the
amount variable with every
for loop step.
And when you run the module now, then you can see that the
amount increases with each year exactly like you want it to increase. But as you can see, it’s not rounded to two decimal places just yet.
Become a Member to join the conversation.