pacho_the_python

Untitled

Oct 22nd, 2021
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. movie_budget = float(input())
  2. current_budget = movie_budget
  3. budget_is_spend = False
  4. total_salary = 0
  5.  
  6. command = input()
  7. while command != "ACTION":
  8.     command_len = len(command)
  9.     if command_len > 15:
  10.         actor_salary = current_budget * 0.2
  11.         current_budget -= actor_salary
  12.         total_salary += actor_salary
  13.  
  14.     else:
  15.         number = float(input())
  16.         current_budget -= number
  17.         total_salary += number
  18.  
  19.     if total_salary > movie_budget:
  20.         budget_is_spend = True
  21.         break
  22.     command = input()
  23. difference = abs(movie_budget - total_salary)
  24. if budget_is_spend:
  25.     print(f"We need {difference:.2f} leva for our actors.")
  26. else:
  27.     print(f"We are left with {difference:.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment