BbJLeB

03. Account Balance

May 12th, 2019
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. # 03. Account Balance
  2. transactions = int(input())
  3.  
  4. bank_sum = 0
  5. counter_transaction = 1
  6.  
  7. while counter_transaction <= transactions:
  8.     current_sum = float(input())
  9.     if current_sum <= 0:
  10.         print("Invalid operation!")
  11.         break
  12.     print(f"Increase: {current_sum:.2f}")
  13.     bank_sum += current_sum
  14.     counter_transaction += 1
  15. print(f"Total: {bank_sum:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment