Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- games = int(input())
- wins = 0
- losses = 0
- days_win = 0
- sum_day = 0
- total_sum = 0
- for i in range(games):
- while True:
- sport = input()
- if sport == "Finish":
- break
- else:
- result = input()
- if result == "win":
- wins += 1
- sum_day += 20
- else:
- losses += 1
- if wins > losses:
- sum_day = 1.10 * sum_day
- days_win += 1
- total_sum += sum_day
- wins = 0
- losses = 0
- sum_day = 0
- if days_win > games / 2:
- total_sum = 1.20 * total_sum
- print(f"You won the tournament! Total raised money: {total_sum:.2f}")
- else:
- print(f"You lost the tournament! Total raised money: {total_sum:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment