secret_word = "hello"
guess = ""
def get_guess():
guess = input("Guess: " )
if guess.isalpha() is not True:
print("Please input a letter")
get_guess()
if len(guess) > 1:
print("Please input a single letter!")
get_guess()
guess = guess.lower()
print(guess)
get_guess()
Code above for a school project, when reaching the “print(guess)” line, will print all prior content.
As example, the input chain “3” “2” “ww” “a” will result in 3,2, and ww being denied before accepting a. However, once reaching the “print(guess)”, it will print, in order
a
ww
2
3
Any ideas?