Advertisement
sibinasto

PB - 28 / 29 March 2020 - 08. Tournamant of Christmas

Jan 17th, 2021
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. days = int(input())
  2. count_days = 0
  3. sums = 0
  4. win = 0
  5. lose = 0
  6. win_day = 0
  7. lose_day = 0
  8. total_sum = 0
  9. for day in range(1, days + 1):
  10.     while True:
  11.         sport = input()
  12.         if sport == "Finish":
  13.             count_days += 1
  14.             break
  15.         w_l = input()
  16.         if w_l == "win":
  17.             sums += 20
  18.             win += 1
  19.         elif w_l == "lose":
  20.             lose += 1
  21.     if win > lose:
  22.         total_sum += (sums * 1.1)
  23.         win = 0
  24.         lose = 0
  25.         sums = 0
  26.         win_day += 1
  27.     else:
  28.         lose_day += 1
  29.         total_sum += sums
  30.         win = 0
  31.         lose = 0
  32.         sums = 0
  33. if win_day > lose_day:
  34.     total_sum *= 1.2
  35.     print(f"You won the tournament! Total raised money: {total_sum:.2f}")
  36. else:
  37.     print(f"You lost the tournament! Total raised money: {total_sum:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement