import random
def play_game():
score = 0
capital_cities = {
"Spain": "Madrid",
"Germany": "Berlin",
"Italy": "Rome",
"Belgium": "Brussels",
"Switzerland": "Bern"
}
for i in range(len(capital_cities)):
country= [Link](list(capital_cities.keys()))
city = capital_cities[country]
capital_cities.pop(country)
choices = []
list_capital_cities = ["Mariehamn", "Tirana", "Athens",
"Pristina", "Riga", "London", "Paris", "Oslo", "Warsaw", "Lisbon",
"Bucharest", "Moscow", "Amsterdam", "Monaco"]
[Link](city)
for i in range(5):
random_county = [Link](list_capital_cities)
[Link](random_county)
list_capital_cities.remove(random_county)
[Link](choices)
answer = input(f"What is the capital choice of {country}?\n
{choices}: ")
if answer == city:
score += 1
print("Correct")
else:
print("Incorrect")
print(f"Your score is {score}")
with open("[Link]", "w") as f:
[Link](f"{score}\n")
retake = input("Do you want to play again? (yes/no): ")
if [Link]() == "yes":
play_game()
else:
pass
play_game()