liveBook · Manning

Find

find is a Python string method that returns the lowest index of a specified substring, or -1 when the substring is absent.

How 2 Manning books explain it

Python How-To

The Python str.find method returns the lowest index at which a specified substring occurs, or -1 if it is absent.

How it is used
Uses string substring searches where absence should produce a testable result instead of an exception.
How deep it goes
Defines the return values, string-only scope, and basic conditional pattern, but does not explain implementation internals.
Examples
Demonstrates checking a returned index and filtering task titles, descriptions, and completion notes.
What you can do after
Apply it via Python strings to locate substrings and branch safely when no match exists.

Read how Python How-To explains find →

Get Programming: Learn to code with Python

find is a Python string method that returns the lowest index of a specified substring or -1 when the substring is absent.

How it is used
Uses substring searches to inspect text and locate separators in user input.
How deep it goes
Explains case sensitivity, indexing, first matches, missing matches, and a slicing application, but stops short of implementation internals.
Examples
Demonstrates searches in "some_string" and "me myself and I", then splits names such as "Aqua Man" using a space.
What you can do after
Apply it to locate substrings or separators, test whether text is present, and guide string slicing.

Read how Get Programming: Learn to code with Python explains find →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.