Functions in a programming language are similar to the functions you have studied for years in mathematics: they perform a task and return a value. As a result, they can greatly enhance the readability of a program and they can make a program easier to write (often by using others' functions).
Chapter 5: Functions
A function performs a task and often returns a value.
def name (parameters): suite-of-statements return something # optional
Driving along, Terry notices that the last four digits on the odometer are palindromic.
A mile later, the last five digits are palindromic.
A mile later, the middle four digits are palindromic.
One mile after that, all six are palindromic.
What was the odometer reading when Terry first looked at it?