Sichanov

ww

Feb 7th, 2021
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. total = 0
  2. # while True:
  3. command = input()
  4. while command != "NoMoreMoney":
  5.     current_amount = float(command)
  6.     if current_amount < 0:
  7.         print("Invalid operation!")
  8.         break
  9.     total += current_amount
  10.     print(f"Increase: {current_amount:.2f}")
  11.     command = input()
  12. print(f'Total: {total:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment