Advertisement
AngelBorislavov

10

May 23rd, 2025
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. loss_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. aureus = 0
  8. shield_broken_counter = 0
  9. for loss in range (1,loss_fights + 1):
  10.     helmet_broken = False
  11.     sword_broken = False
  12.  
  13.     if loss % 2 == 0:
  14.         aureus+= helmet_price
  15.         helmet_broken = True
  16.  
  17.     if loss % 3 == 0:
  18.         aureus+= sword_price
  19.         sword_broken = True
  20.  
  21.     if helmet_broken and sword_broken:
  22.         aureus += shield_price
  23.         shield_broken_counter += 1
  24.  
  25.         if shield_broken_counter % 2 == 0:
  26.             aureus += armor_price
  27.  
  28. print(f'Gladiator expenses: {aureus:.2f} aureus')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement