Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. id| info
  2.  
  3. 1112| storage is full and needs extra space
  4.  
  5. 1112| there is many problems with space
  6.  
  7. 1113| pickup cars come and take the garbage
  8.  
  9. 1113| payment requires for the garbage
  10.  
  11. id| info
  12.  
  13. 1112| storage is full and needs extra space there is many problems with space
  14.  
  15. 1113| pickup cars come and take the garbage payment requires for the garbage
  16.  
  17. from collections import defaultdict
  18.  
  19. by_id = defaultdict(list)
  20.  
  21. for id, info in your_list:
  22. by_id[id].append(info)
  23.  
  24. for key, value in by_id.items()
  25. print(key, value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement