Computer Science, asked by hopator750, 6 months ago

Write a program to accept name of 10 countries and their capital.Input name of countries and find whether it exist in the list if
yes then display name of country and its capital?

Answers

Answered by valeriy69
0

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

def find_capital(country):

countries = {

"Austria": "Vienna",

"Bulgaria": "Sofia",

"Canada": "Ottawa",

"Denmark": "Copenhagen",

"Egypt": "Cairo",

"France": "Paris",

"Germany": "Berlin",

"Hungary": "Budapest",

"India": "Delhi",

"Japan": "Tokyo"

}

if country not in countries:

return "Country not found!"

return f"Country: {country}\nCapital: {countries[country]}"

country = input("Enter country: ")

print(find_capital(country))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions