Advertisement
Redomine

Футболисты геи

Jul 11th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. team_list={}
  2.  
  3. games_played=int(input())
  4.  
  5. for count in range(games_played):
  6. data_input=[(i) for i in input().split(';')]
  7. score_list=[]
  8. current_teams=[]
  9.  
  10. for data in data_input:
  11. if data_input[0]==data or data_input[2]==data:
  12. team_input=data
  13. if team_input in team_list:
  14. team_list[team_input][0]+=1
  15. else: team_list[(team_input)]=[1, 0, 0, 0, 0]
  16. current_teams.append(data)
  17. else: score_list.append(data)
  18.  
  19. if score_list[0]>score_list[1]: #выбираем победившую команду раз
  20. team_list[(current_teams[0])][1]+=1 #счетчик побед
  21. team_list[(current_teams[0])][4]+=3 #счетчик очков
  22. team_list[(current_teams[1])][3]+=1 #счетчик поражений
  23.  
  24. elif score_list[1]>score_list[0]: #второй вариант
  25. team_list[(current_teams[1])][1]+=1 #счетчик побед
  26. team_list[(current_teams[1])][4]+=3 #счетчик очков
  27. team_list[(current_teams[0])][3]+=1 #счетчик поражений
  28.  
  29. if score_list[0]==score_list[1]: #ничья
  30. team_list[(current_teams[0])][2]+=1 #счетчик ничьих
  31. team_list[(current_teams[1])][2]+=1 #счетчик ничьих
  32. team_list[(current_teams[0])][4]+=1 #счетчик очков
  33. team_list[(current_teams[1])][4]+=1 #счетчик очков
  34.  
  35. for total in team_list:
  36. print(total+':'+(str(team_list[total][0])), (*team_list[total][1:]), end=('\n'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement