Geek Culture
Published in

Geek Culture

Python: How fast are Dicts vs Lists?

So, you have a list of objects with IDs, and you need to find an object by its id. How do you keep your objects? In a list or in a dict?

Though this is obvious for experienced developers, it may not be so clear why dicts perform better.

This is another experiment for those who learn to program in Python.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store