Teo_Yanchev

christams_tournament_28-29-2020_exam

Jul 17th, 2020
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. days = int(input())
  2.  
  3. win_total_money = 0
  4. win_total = 0
  5. lose_total = 0
  6. for day in range(1, days+1):
  7.  
  8. win = 0
  9. win_count = 0
  10. lose_count = 0
  11. money_wins = 0
  12. command = input()
  13. while command != "Finish":
  14. sport = command
  15. result = input()
  16.  
  17. if result == "win":
  18. win_total += 1
  19. win_count += 1
  20. money_wins = 20
  21. win += money_wins
  22. else:
  23. lose_total += 1
  24. lose_count += 1
  25. command = input()
  26. if win_count > lose_count:
  27. win_total_money += win + (win * 0.10)
  28. else:
  29. win_total_money += win
  30.  
  31. if win_total > lose_total:
  32. win_total_money += (win_total_money * 0.20)
  33. print(f"You won the tournament! Total raised money: {win_total_money:.2f}")
  34. else:
  35. print(f"You lost the tournament! Total raised money: {win_total_money:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment