Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- team_list={}
- games_played=int(input())
- for count in range(games_played):
- data_input=[(i) for i in input().split(';')]
- score_list=[]
- current_teams=[]
- for data in data_input:
- if data_input[0]==data or data_input[2]==data:
- team_input=data
- if team_input in team_list:
- team_list[team_input][0]+=1
- else: team_list[(team_input)]=[1, 0, 0, 0, 0]
- current_teams.append(data)
- else: score_list.append(data)
- if score_list[0]>score_list[1]: #выбираем победившую команду раз
- team_list[(current_teams[0])][1]+=1 #счетчик побед
- team_list[(current_teams[0])][4]+=3 #счетчик очков
- team_list[(current_teams[1])][3]+=1 #счетчик поражений
- elif score_list[1]>score_list[0]: #второй вариант
- team_list[(current_teams[1])][1]+=1 #счетчик побед
- team_list[(current_teams[1])][4]+=3 #счетчик очков
- team_list[(current_teams[0])][3]+=1 #счетчик поражений
- if score_list[0]==score_list[1]: #ничья
- team_list[(current_teams[0])][2]+=1 #счетчик ничьих
- team_list[(current_teams[1])][2]+=1 #счетчик ничьих
- team_list[(current_teams[0])][4]+=1 #счетчик очков
- team_list[(current_teams[1])][4]+=1 #счетчик очков
- for total in team_list:
- print(total+':'+(str(team_list[total][0])), (*team_list[total][1:]), end=('\n'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement