Advertisement
bl00dt3ars

05. Account Balance

Oct 31st, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. n = input()
  2. total = 0.0
  3.  
  4. while n != "NoMoreMoney":
  5.     amount = float(n)
  6.     if amount < 0:
  7.         print("Invalid operation!")
  8.         break
  9.     total += amount
  10.     print(f"Increase: {amount:.2f}")
  11.     n = input()
  12. print(f"Total: {total:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement