I am trying to stop this program if the number the person enters is not 4 numbers long, using the try-except structure. I don't really get why it skips the except block if I enter a 2 or 3 digit number for example. All help appreciated.
guess = int(input('Guess a 4 digit number:\n'))
guesslist = [int(x) for x in (str(guess))]
x = 0
y = 0
try:
print(len(str(guess)))
len(str(guess)) == 4
except:
print('please enter a 4 digit number')
quit()
print('past')