Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tournament_name = input()
- games_won = 0
- games_lost = 0
- games_counter = 0
- counter_for_all_games = 0
- while tournament_name != 'End of tournaments':
- games = int(input())
- for x in range(0, games):
- games_counter += 1
- counter_for_all_games += 1
- score_team_desi = int(input())
- score_opposing_team = int(input())
- if score_team_desi > score_opposing_team:
- games_won += 1
- print(f'Game {games_counter} of tournament {tournament_name}: win with '
- f'{score_team_desi - score_opposing_team} points.')
- if score_team_desi < score_opposing_team:
- games_lost += 1
- print(f'Game {games_counter} of tournament {tournament_name}: lost with '
- f'{score_opposing_team - score_team_desi} points.')
- games_counter = 0
- tournament_name = input()
- percentage_won = games_won * 1.00 / counter_for_all_games * 100
- percentage_lost = games_lost * 1.00 / counter_for_all_games * 100
- print(f'{percentage_won:.2f}% matches win')
- print(f'{percentage_lost:.2f}% matches lost')
Advertisement
Add Comment
Please, Sign In to add comment