Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 01 The Hunting Game , Mid Exam Fundamentals Python June.2022
- total_days = int(input())
- players = int(input())
- energy = float(input())
- water = float(input())
- food = float(input())
- total_water = water * players * total_days
- total_food = food * players * total_days
- out_of_energy = False
- for day in range(1, total_days + 1):
- lost_energy = float(input())
- if energy <= lost_energy:
- out_of_energy = True
- break
- energy -= lost_energy
- if day % 2 == 0:
- energy *= 1.05
- total_water *= 0.70
- if day % 3 == 0:
- total_food -= total_food / players
- energy *= 1.10
- if not out_of_energy:
- print(f"You are ready for the quest. You will be left with - {energy:.2f} energy!")
- else:
- print(f"You will run out of energy. You will be left with "
- f"{total_food:.2f} food and {total_water:.2f} water.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement