August 2021
Beginner to intermediate
118 pages
1h 29m
English
| Puzzle 15 | Where’s Waldo? |
| | name = 'Waldo' |
| | text = 'Can you find where Wally is?' |
| | |
| | if text.find(name): |
| | print('Found Waldo') |
| | else: |
| | print('Cannot find Waldo') |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print: Found Waldo
The str.find documentation says
Return -1 if sub is not found.
We have two Boolean values in Python: True and False. They weren’t always there; they ...
Read now
Unlock full access