Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name_tournament=input()
- #number_of_games=int(input())
- games_counter=0
- victories=0
- losses=0
- while name_tournament != "End of tournaments":
- current_tournament = name_tournament
- number_of_games = int(input())
- for game in range (number_of_games):
- points_desi=int(input())
- points_opponent=int(input())
- games_counter += 1
- if points_desi > points_opponent:
- victories += 1
- difference = abs(points_desi - points_opponent)
- print(f"Game {games_counter} of tournament {name_tournament}: win with {difference} points.")
- elif points_desi < points_opponent:
- losses += 1
- difference= abs(points_desi - points_opponent)
- print(f"Game {games_counter} of tournament {name_tournament}: lost with {difference} points.")
- name_tournament = input()
- percentage_victories = victories / games_counter * 100
- percentage_losses = losses / games_counter * 100
- print(f"{percentage_victories:.2f}% matches win")
- print(f"{percentage_losses:.2f}% matches lost")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement