You actually have not done anything wrong. Codecademy's submission correctness test (SCT) for this exercise looks for a variable named
word. If you first test your code by entering an empty string, that variable does not get created, because the
else block executes instead of the
if block. The SCT then issues a complaint because
word was not created. In my opinion, this is a bug in the SCT rather than in your code.
The best, though not the only, remedy is to leave your code as is, and submit it again. Enter a valid word, and you will pass. After that, you can continue to test your code until you are satisfied with it.