Advertisement
George_Ivanov05

10 Gladiator Expenses

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