diff --git a/ch09-lists-tuples-and-dictionaries/7-challenge-capital-city-loop.py b/ch09-lists-tuples-and-dictionaries/7-challenge-capital-city-loop.py index 8eca70b..5c02900 100644 --- a/ch09-lists-tuples-and-dictionaries/7-challenge-capital-city-loop.py +++ b/ch09-lists-tuples-and-dictionaries/7-challenge-capital-city-loop.py @@ -58,11 +58,13 @@ # Pull random state and capital pair from the dict by casting to list of tuples state, capital = random.choice(list(capitals_dict.items())) - +print(state) # Game loop continues until the user inputs "exit" # or guesses the correct capital while True: - guess = input(f"What is the capital of '{state}'? ").lower() + # all the above words of capitals and states start with capital letter so no use of .lower() + print("enter the state capital word with first letter only as capital") + guess = input(f"What is the capital of '{state}'? ") if guess == "exit": print(f"The capital of '{state}' is '{capital}'.") print("Goodbye")