[Python] Code for a program isn't behaving as it should [closed]

Discussão em 'Python' iniciado por Stack, Fevereiro 14, 2025.

  1. Stack

    Stack Membro Participativo

    The following code is being run:

    p2_name = input("What is your name, player two? ").capitalize()
    cat_tuple = ("asher", "psalms", "acts", "lucha", "whiskers", "eve")
    p2_cat = input(f"Which cat do you choose, {p2_name}? (Asher, Psalms, Acts, Lucha, Whiskers, Eve): ")
    while not p2_cat in cat_tuple:
    print("That's not an option")
    p2_cat = input(f"Which cat do you choose, {p2_name}? (Asher, Psalms, Acts, Lucha, Whiskers, Eve): ").lower()


    Whenever I type an answer from cat_tuple for the input, it returns this the first time I answer it:

    That's not an option


    But It works fine the second time I answer. I need advice so that it works on the first time

    Continue reading...

Compartilhe esta Página