← All hands-on practice
Python · 8 min
Not that word
status is down. differ.py asks if it is not down, which it is, so the else runs. Change the test so it asks if status is not up.
Start it: free, in your browser, no account
What you will do
- Read differ.py.
- Run differ.py. It prints same.
- Change the test so it asks if status is not up.
- Run differ.py again. It prints changed.
This stop adds if name != "text":. else: can sit under it. No and, and no elif.