Advertisement
miglenabs

Untitled

Dec 1st, 2022
801
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. budget = float(input())
  2.  
  3.  
  4. left_budget = budget
  5. input_line = input()
  6. while input_line != "ACTION":
  7.     name = str(input_line)
  8.     if len(name) <= 15:
  9.         payment = float(input())
  10.         left_budget -= payment
  11.     elif len(name) > 15:
  12.         payment = left_budget * 0.2
  13.         left_budget -= payment
  14.     if left_budget == 0:
  15.         break
  16.  
  17.     input_line = input()
  18.  
  19. diff = abs(left_budget - payment)
  20. if left_budget >= payment:
  21.     print(f"We are left with {diff:.2f} leva.")
  22. else:
  23.     print(f"We need {diff:.2f} leva for our actors.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement