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