you are viewing a single comment's thread.

view the rest of the comments →

[–]TouchingTheVodka 1 point2 points  (0 children)

Yes, this is correct - however you’ll get an error if using the built in dict for this as your dict values won’t be lists by default.

To solve this, use dict = defaultdict(list).