Advertisement
exDotaPro

2019_6_july_5_football_tournament

Feb 1st, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. team_name = input()
  2. matches_payed = int(input())
  3.  
  4. if matches_payed == 0:
  5.     print(f'{team_name} hasn\'t played any games during this season.')
  6.     exit(0)
  7.  
  8. wins = 0
  9. draws = 0
  10. loses = 0
  11. points = 0
  12.  
  13. for matches in range(matches_payed):
  14.     result = input()
  15.  
  16.     if result == 'W':
  17.         wins += 1
  18.         points += 3
  19.     elif result == 'D':
  20.         draws += 1
  21.         points += 1
  22.     elif result == 'L':
  23.         loses += 1
  24.  
  25. win_percentage = wins / matches_payed * 100
  26.  
  27. print(f'{team_name} has won {points} points during this season.')
  28. print('Total stats:')
  29. print(f'## W: {wins}')
  30. print(f'## D: {draws}')
  31. print(f'## L: {loses}')
  32. print(f'Win rate: {win_percentage:.2f}%')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement