Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id| info
- 1112| storage is full and needs extra space
- 1112| there is many problems with space
- 1113| pickup cars come and take the garbage
- 1113| payment requires for the garbage
- id| info
- 1112| storage is full and needs extra space there is many problems with space
- 1113| pickup cars come and take the garbage payment requires for the garbage
- from collections import defaultdict
- by_id = defaultdict(list)
- for id, info in your_list:
- by_id[id].append(info)
- for key, value in by_id.items()
- print(key, value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement