We use cookies on this site to enhance your user experience

By clicking the Accept button, you agree to us doing so. More info on our cookie policy

Blog

Hashable objects for maps in Python

Maps in Python are called dict. To create one, you have to choose an hashable object as key and a value.
What is an hashable object?
An hashable object is an object with a hash which never changes during its lifetime. Such objects are called immutable.
Python offers the following hashable built-in objects.

How to sort 7.7 bilion people

As of today there are around 7.7 bilion people in the world.
Image that we have a file containing all the people, line by line like this: