Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name_of_tournament = input()
- number_of_games = int(input())
- points_for_winning = 0
- win_counter = 0
- loss_counter = 0
- game_counter = 0
- input_text = input()
- while input_text != "End of tournaments":
- desi_team = int(input_text)
- other_team = int(input())
- game_counter += 1
- if desi_team > other_team:
- points_for_winning += abs(desi_team - other_team)
- win_counter += 1
- print(f"Game {win_counter} of tournament {name_of_tournament}: win with {points_for_winning}")
- points_for_winning = 0
- else:
- points_for_winning += abs(desi_team - other_team)
- loss_counter += 1
- print(f"Game {loss_counter} of tournament {name_of_tournament} lost with {points_for_winning}")
- points_for_winning = 0
- input_text = input()
- win_perc = win_counter / game_counter * 100
- loss_perc = loss_counter / game_counter * 100
- if input_text == "End of tournaments":
- print(f"{win_perc:.2f}% matches win")
- print(f"{loss_perc:.2ff}% matches lost")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement