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") pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy