Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- country_capitals = {
- "Australia": "Canberra",
- "India": "Delhi",
- "Japan": "Tokyo"
- }
- score = 0
- import random
- while len(country_capitals):
- print(f"Your current score is {score}.\n")
- country = random.choice(list(country_capitals.keys()))
- capital = country_capitals.pop(country)
- ans = input(f"What is the Capital of {country}: ")
- if ans.lower() == capital.lower():
- print("Good Job")
- score += 1
- else:
- print(f"Nah, the capital for {country} is {capital}.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement