simeonshopov

Movie Stars (june exam)

Nov 7th, 2019
147
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. actor = input()
  3. not_enough = False
  4. pay_check = 0
  5.  
  6. while actor != "ACTION":
  7.   if len(actor) <= 15:
  8.     pay_check = float(input())
  9.     if pay_check > budget:
  10.       not_enough = True
  11.       break
  12.     else:
  13.       budget -= pay_check
  14.   else:
  15.     pay_check = budget * 0.2
  16.     if pay_check > budget:
  17.       not_enough = True
  18.       break
  19.     else:
  20.       budget -= pay_check
  21.   actor = input()
  22. else:
  23.   print(f"We are left with {budget:.2f} leva.")
  24. if not_enough:
  25.     print(f"We need {(pay_check - budget):.2f} leva for our actors.")
Add Comment
Please, Sign In to add comment