Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name_of_team = input()
- games_played = int(input())
- win = 0
- draw = 0
- loose = 0
- win_count = 0
- draw_count = 0
- loose_count = 0
- total_points = 0
- percent_won = 0
- if games_played <= 0:
- print(f"{name_of_team} hasn't played any games during this season.")
- for i in range(1, games_played + 1):
- result_of_game = input()
- if result_of_game == 'W':
- win += 3
- win_count += 1
- elif result_of_game == 'D':
- draw += 1
- draw_count += 1
- elif result_of_game == 'L':
- loose += 0
- loose_count += 1
- total_points = win + draw
- percent_won = (win_count / games_played) * 100
- print(f'{name_of_team} has won {total_points} points during this season.')
- print('Total stats:')
- print(f'## W: {win_count}\n## D: {draw_count}\n## L: {loose_count}')
- print(f'Win rate: {percent_won:.2f}%')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement