Advertisement
bl00dt3ars

06. Tournament of Christmas

Nov 9th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. days = int(input())
  2. total_wins = 0
  3. total_loses = 0
  4. total_earned_money = 0
  5.  
  6. for i in range(days):
  7.     wins = 0
  8.     loses = 0
  9.     line = input()
  10.     while line != "Finish":
  11.         result = input()
  12.         earned_money = 0
  13.         if result == "win":
  14.             wins += 1
  15.             total_wins += 1
  16.         else:
  17.             loses += 1
  18.             total_loses += 1
  19.         line = input()
  20.     if wins > loses:
  21.             earned_money = wins * 20 * 1.1
  22.     else:
  23.             earned_money = wins * 20
  24.     total_earned_money += earned_money
  25. if total_wins > total_loses:
  26.     print(f"You won the tournament! Total raised money: {total_earned_money * 1.2:.2f}")
  27. else:
  28.     print(f"You lost the tournament! Total raised money: {total_earned_money:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement