This is a Python project that allows users to search for countries and retrieve important information such as:
- Capital city
- Continent
- Population
The system uses a CSV file as a database and implements a Binary Search Algorithm for fast searching.
- Search for any country
- Displays:
- Capital
- Continent
- Population
- Handles invalid or non-existing countries
- Uses efficient binary search
- Reads data from a CSV file
- Python 🐍
- CSV module (built-in)
- Binary Search Algorithm
project/ │── main.py │── countries.csv │── README.md
-
Make sure Python is installed
-
Open your project folder in VS Code
-
Run the program: python main.py
-
Enter a country name when prompted
Enter country name (or exit to quit): Nigeria
Country: Nigeria Capital: Abuja Continent: Africa Population: 242431832
- Country names must be spelled correctly
- The search is case-insensitive (thanks to
.title())
- Loads data from
countries.csv - Stores:
- Country names in a sorted list
- Country details in a dictionary
- Uses Binary Search to check if the country exists
- Retrieves and displays the country's data
- Add GUI (Graphical User Interface)
- Add fuzzy search (handle misspellings)
- Connect to an API for real-time data
- Add flags and languages
Eniola (Harid_joy)
This project was built as part of learning:
- Data Structures
- Algorithms (Binary Search)
- File Handling in Python