Until they type stop
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
This one builds on a lesson you haven't finished yet. Do that lesson first:
Python Basics · While loops →
Until they type stop
Keep reading words with input() and printing each one back, until the word is stop. Do not print stop itself.
The value the loop tests has to be read before the loop starts, and read again at the end of every turn — otherwise the same word is tested for ever. != means is not equal to.
Keep reading words with input() and printing each one back, until the word is stop. Do not print stop itself.
Click Run to see the output here.