Advertisement
George_Ivanov05

a

Mar 6th, 2021
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. total = 0
  2.  
  3. # command = "NoMoreMoney" OR "45.45"
  4. # stop - > if command == "NoMoreMoney"
  5. # continue -> command != "NoMoreMoney"
  6. # repeat: sum like a number - IF
  7. # if < 0 -> stop
  8. # if >= 0 print sentence -> add to sum
  9.  
  10. command = input()
  11.  
  12. while command != "NoMoreMoney":
  13.     total = float(command)
  14.     if total < 0:
  15.         print("Invalid operation!")
  16.         break
  17.     else:
  18.         print(f"Increase: {total:.2f}")
  19.         total_sum += total
  20.  
  21.     command = input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement