Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tournament_duration = int(input())
- tournament_over = False
- days_count = 0
- daily_money = 0
- total_money = 0
- daily_wins = 0
- daily_losses = 0
- total_wins = 0
- total_losses = 0
- while not tournament_over:
- while days_count <= tournament_duration:
- command = input()
- if command == "Finish":
- break
- result = input()
- if result == "win":
- daily_money += 20
- daily_wins += 1
- total_wins += 1
- elif result == "lose":
- daily_losses += 1
- total_losses += 1
- if daily_wins > daily_losses:
- daily_money *= 1.1
- elif daily_wins < daily_losses:
- tournament_over = False
- total_money += daily_money
- daily_wins = 0
- daily_losses = 0
- daily_money = 0
- days_count += 1
- if days_count < tournament_duration:
- tournament_over = False
- continue
- else:
- tournament_over = True
- break
- if total_wins > total_losses:
- total_money *= 1.2
- print(f"You won the tournament! Total raised money: {total_money:.2f}")
- else:
- print(f"You lost the tournament! Total raised money: {total_money:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement