In Python trying to get user input to match one my numbers in my list but so far no success Still a beginner and having trouble debugging If anyone can point out what I am doing wrong

0 votes
while True:
    secret_number: list[int] = [1, 2, 3]
    guess: str = input("Guess a number: ")

    if guess == "q":
        break
    if guess == (secret_number[2]):
        print("You win. The secret number is {0}".format(secret_number))
        break
    else:
        msg = "You lost. The secret number is {0}. Your guess is {1}"
        print(msg.format(secret_number, guess))
Sep 13, 2021 in Python by anonymous

edited 5 days ago 15 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP