Advertisement
George_Ivanov05

10. Gladiator expenses

May 30th, 2021
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1.  
  2. # Creating variables
  3. lose_fight_count = int(input())
  4. helmet_price = float(input())
  5. sword_price = float(input())
  6. shield_price = float(input())
  7. armor_price = float(input())
  8.  
  9. # Creating counter variables
  10. helmet_counter = 0
  11. sword_counter = 0
  12. shield_counter = 0
  13. armor_counter = 0
  14.  
  15. for lost_fight in range(1, lose_fight_count + 1):
  16.     if lost_fight % 2 == 0:
  17.         helmet_counter += 1
  18.     if lost_fight % 3 == 0:
  19.         sword_counter += 1
  20.         if lost_fight % 2 == 0:
  21.             shield_counter += 1
  22.         if shield_counter % 2 == 0 and shield_counter > 0:
  23.             armor_counter += 1
  24. expenses = (helmet_price * helmet_counter) + (sword_price * sword_counter) + (shield_price * shield_counter) + (armor_price * armor_counter)
  25. print(f"Gladiator expenses:Autobiography {expenses:.2f} aureus")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement