Advertisement
anton_d

10. gladiator_expenses

May 25th, 2022
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. lost_fights = int(input())
  2. helmet_price = float(input())
  3. sword_price = float(input())
  4. shield_price = float(input())
  5. armor_price = float(input())
  6.  
  7. budget = 0
  8. shield_breaks = 0
  9.  
  10. for fight in range(1, lost_fights+1):
  11.     if fight % 2 == 0:
  12.         budget += helmet_price
  13.     if fight % 3 == 0:
  14.         budget += sword_price
  15.     if fight % 3 == 0 and fight % 2 == 0:
  16.         budget += shield_price
  17.         shield_breaks += 1
  18.     if shield_breaks == 2:
  19.         budget += armor_price
  20.         shield_breaks = -1
  21. print(f'Gladiator expenses: {budget:.2f} aureus')
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement