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