Teo_Yanchev

basketball_tournaments_9-10-2019_exam

Jul 15th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. command = input()
  2.  
  3. win = 0
  4. lost = 0
  5. games_count = 0
  6.  
  7. while command != "End of tournaments":
  8. name = command
  9. matches = int(input())
  10.  
  11. games_count += matches
  12. desi_team = 0
  13. opposite_team = 0
  14. game = 0
  15.  
  16. for i in range(1, matches+1):
  17. desi_team = int(input())
  18. opposite_team = int(input())
  19. game += 1
  20. if desi_team > opposite_team:
  21. win += 1
  22. print(f"Game {game} of tournament {name}: win with {desi_team - opposite_team} points.")
  23. else:
  24. lost += 1
  25. print(f"Game {game} of tournament {name}: lost with {opposite_team - desi_team} points.")
  26. command = input()
  27. else:
  28. win = win / games_count * 100
  29. print(f"{win:.2f}% matches win")
  30. lost = lost / games_count * 100
  31. print(f"{lost:.2f}% matches lost")
Advertisement
Add Comment
Please, Sign In to add comment