Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count_of_days = int(input())
- money_earned = 0
- games_won = 0
- games_lost = 0
- days_won = 0
- days_lost = 0
- for days in range(count_of_days):
- command = input()
- games_won = 0
- games_lost = 0
- while command != "Finish":
- result = input()
- if result == 'win':
- games_won += 1
- money_earned += 20
- elif result == 'lose':
- games_lost += 1
- command = input()
- if games_won > games_lost:
- days_won += 1
- money_earned *= 1.1
- else:
- days_lost += 1
- if days_won > days_lost:
- money_earned *= 1.2
- print(f'You won the tournament! Total raised money: {money_earned:.2f}')
- else:
- print(f'You lost the tournament! Total raised money: {money_earned:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment