Codington
0 of 6 problems solved • 0%

Exercise prompt

Update the Counter

An assignment can use the current value of the same name on its right-hand side.

Example

charge = 20 charge = charge - 4 print(charge) # 16 charge += 1 print(charge) # 17

The first assignment after the starting value subtracts four. The shorter += then adds one to the new value.

Your task

The starter counts books on a shelf. Record how many were there after_return when five books came back. Then three books are borrowed. Update books to the final count. Keep the saved count.