desislava_topuzakova

06. Godzilla vs. Kong

Mar 17th, 2021
800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.12 KB | None | 0 0
  1. # декор = 10%  от бюджета = 0.1 * бюджета
  2. # облекло = Брой на статистите * цена за 1 статист
  3. # отстъпка за облекло -> ако броят на статистите > 150
  4.                         # облекло - 15%
  5. # разходи = декор + облекло
  6. # проверка дали стига бюджетът
  7.  
  8. budget = float(input())
  9. count_statists = int(input())
  10. price_clothes_per_statist = float(input())
  11.  
  12. price_decor = 0.1 * budget
  13. price_clothes = count_statists * price_clothes_per_statist
  14.  
  15. if count_statists > 150:
  16.     price_clothes = price_clothes - 0.10 * price_clothes
  17.     # price_clothes = 0.9 * price_clothes
  18.  
  19. expenses = price_decor + price_clothes
  20.  
  21. if expenses > budget:
  22.     # бюджетът не е достатъчен
  23.     print("Not enough money!")
  24.     need_money = expenses - budget
  25.     print(f"Wingard needs {need_money:.2f} leva more.")
  26. else:
  27.     # бюджетът е достатъчнo
  28.     print('Action!')
  29.     left_money = budget - expenses
  30.     print(f"Wingard starts filming with {left_money:.2f} leva left.")
Advertisement
Add Comment
Please, Sign In to add comment