user_guess = input("Guess a letter: ")
if len(user_guess) > 1 and user_guess in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':
print("E1")
elif user_guess not in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':
print("E2")
elif(len(user_guess) > 1) and (user_guess not in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'):
print("E3")
else:
print(user_guess.lower())
>Solution :
if user_guess in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
This is only true if user_guess is not a substring of the entire alphabet (in that order). I think this isn’t what you want. My guess is that you want to make sure that user_guess is only made up of alphabetic characters.
You can do this yourself, by checking each character of user_guess.
Or you can just do
if user_guess.isalpha()