Advertisement
Spocoman

Account Balancе

Jan 4th, 2022 (edited)
85
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.     print(f'Increase: {money:.2f}')
  10.     sum += money
  11.     n = input()
  12.  
  13. print(f'Total: {sum:.2f}')
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement