Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exp_needed = float(input())
- battles = int(input())
- exp_collected = 0
- battles_counter = 0
- for i in range(1, battles + 1):
- exp_earned_per_battle = float(input())
- battles_counter += 1
- exp_earned_for_current_battle = exp_earned_per_battle
- if i % 3 == 0:
- exp_earned_for_current_battle *= 1.15
- if i % 5 == 0:
- exp_earned_for_current_battle *= 0.9
- if i % 15 == 0:
- exp_earned_for_current_battle *= 1.05
- exp_collected += exp_earned_for_current_battle
- if exp_collected >= exp_needed:
- print(f"Player successfully collected his needed experience for {battles_counter} battles.")
- break
- if exp_collected < exp_needed:
- print(f"Player was not able to collect the needed experience, {exp_needed - exp_collected:.2f} more needed.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement