This Python script provides a seamless way to link countries with their respective capitals. The underlying data for this script is derived from two Indonesian-language websites:
Users can input a country's name and instantly retrieve its corresponding capital. The output displays the capital city of the entered country. Additionally, the script randomly showcases the capital of another country, providing users with diverse country-capital pairs for exploration.
The functionality is implemented through a dictionary structure in Python. Country names serve as keys, while their corresponding capitals are stored as values. If the entered country does not match any entry in the dataset, the script informs the user about the absence of that country in the database.
To enhance user experience, the code also includes a feature that randomly displays the capital of a different country, broadening the scope beyond the initial query.
Please note that the code's explanations and functionality details are provided in English, but the sources for the country-capital data are Indonesian-language websites.