[Solved] Why won’t my ‘else’ statement work in python? [closed]


This is perhaps a bit of an aside, but you could greatly simplify this by saying:

while True:
    guess = input("Guess one letter in the word!: ")

    if guess in l:
        print("Correct")
    else:
        print("Incorrect")

This would also have the side effect of allowing you to change your word to guess to one of a different length, without having to change your if/else chain.

To know why Incorrect isn’t being printed, we’ll need to know the value of l.

1

solved Why won’t my ‘else’ statement work in python? [closed]