...

/

Puzzle 15: Explanation

Puzzle 15: Explanation

Let’s learn how the str.find function works in Python.

We'll cover the following...

Try it yourself

Try executing the code below to verify the result:

Press + to interact
name = 'Waldo'
text = 'Can you find where Wally is?'
if text.find(name):
print('Found Waldo')
else:
print('Cannot find Waldo')

Explanation

Note: The str.find documenta ...