Modules in Python, Constructing Apps With Isolated Building Blocks

In this article, we’ll explore modules in Python. Modules are great for organizing our code into smaller building blocks that can be developed in isolation. We’ll see how to create a module and how to use it, we’ll also see how to use already existing modules that are built in the language library.

For this tutorial, we have a simple exercise to solve. We have a set of cities names and their corresponding country. We want to let the user search for a certain city to find in which country it is located.