Hacker News new | ask | show | jobs
by pdonis 4603 days ago
Lists can't hold two of the same object

Yes, they can. Try it! The index method has extra arguments to let you specify a range of indexes in the list to search, so you can find multiple indexes that point to the same object (by picking a range that excludes indexes you've previously found).

Dicts return the key by default

Dicts don't have an index method; dict keys are not ordered.