Sichanov

xmas tournament

Jul 18th, 2021
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. total_days = int(input())
  2. total_money = 0
  3. days_won = 0
  4. days_lost = 0
  5. for day in range(1, total_days + 1):
  6.     command = input()
  7.     daily_won_games = 0
  8.     daily_lost_games = 0
  9.     daily_money = 0
  10.     while command != 'Finish':
  11.         win_or_lose = input()
  12.         if win_or_lose == 'win':
  13.             daily_money += 20
  14.             daily_won_games += 1
  15.         elif win_or_lose == 'lose':
  16.             daily_lost_games += 1
  17.  
  18.         command = input()
  19.     if daily_won_games > daily_lost_games:
  20.         days_won += 1
  21.         daily_money *= 1.10
  22.     else:
  23.         days_lost += 1
  24.     total_money += daily_money
  25. if days_won > days_lost:
  26.     total_money *= 1.20
  27.     print(f"You won the tournament! Total raised money: {total_money:.2f}")
  28. else:
  29.     print(f"You lost the tournament! Total raised money: {total_money:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment