Advertisement
Spocoman

05. Account Balance

Dec 27th, 2021 (edited)
112
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. sum = 0
  3.  
  4. while n != "NoMoreMoney":
  5.     money = float(n)
  6.     if money < 0:
  7.         print('Invalid operation!')
  8.         break
  9.        
  10.     print(f'Increase: {money:.2f}')
  11.     sum += money
  12.     n = input()
  13.  
  14. print(f'Total: {sum:.2f}')
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement