Advertisement
pacho_the_python

Untitled

Mar 28th, 2022
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. data = input()
  2.  
  3. player_dict = {}
  4. while True:
  5.  
  6.     if data == "Season end":
  7.         break
  8.     player_data = data.split(" -> ")
  9.     name = player_data[0]
  10.     position = player_data[1]
  11.     skill = int(player_data[2])
  12.  
  13.     if name not in player_dict:
  14.         player_dict[name] = [{position: skill}]
  15.     else:
  16.         player_dict[name] += [{position: skill}]
  17.  
  18.     data = input()
  19. print(player_dict)
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement