Advertisement
Veselina_M

Untitled

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