← All hands-on practice
Python · 8 min
The other result
branch.py prints blocked when the word is in the line, and clear when it is not. Read it, run it, then change the word so you get the other result.
Start it: free, in your browser, no account
What you will do
- Read branch.py.
- Run branch.py. It prints blocked.
- Change the if so it looks for Accepted.
- Run branch.py again. It prints clear.
This Python only adds else: directly under if "text" in name:. No elif, and no other test.