You’re close, but not quite there.
- Initialize the
Entry
variable so that thewhile
loop can test it. - Move the
input
so that it’s the first operation of thewhile
loop, then test forEXIT
. - Set up a
if
/elif
/else
branch routine (inside of thewhile
loop), so that you have three tests. Hint: the first test will be forEXIT
, then for a word in your dictionary, then for everything else, which will loop back unless we have anEXIT
condition.
I’ve left out some detail here, so that you will fall over it and learn more by figuring it out, but if you’d rather have a complete solution, simply say as much.
The so-called Walrus operator that @vainaixr has suggested is one way, but, as a beginner, I would suggest that you acknowledge the existence of that operator, while at the same time avoid using it for now: it’s a relatively new operator, not widely used and not available with Python versions below 3.8
It’s a shame that you didn’t continue with your flights / connections project…
… as you would have had to have learned these kind of tests and loops, while developing that, still never mind.
edit done for a correction.