Sichanov

ggg

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