Advertisement
Spocoman

Tournament of Christmas

Feb 25th, 2022 (edited)
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. days = int(input())
  2.  
  3. win_total = 0
  4. lose_total = 0
  5. sum_total = 0
  6.  
  7. for i in range(days):
  8.     win = 0
  9.     lose = 0
  10.     sum = 0
  11.     while True:
  12.         command = input()
  13.         if command == "win":
  14.             sum += 20
  15.             win += 1
  16.         elif command == "lose":
  17.             lose += 1
  18.         elif command == "Finish":
  19.             if win > lose:
  20.                 sum_total += sum * 1.1
  21.                 win_total += win
  22.             else:
  23.                 sum_total += sum
  24.                 lose_total += lose
  25.             break
  26.        
  27. if win_total > lose_total:
  28.     print(f"You won the tournament! Total raised money: {sum_total * 1.2:.2f}")
  29. else:
  30.     print(f"You lost the tournament! Total raised money: {sum_total:.2f}")
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement