Chapter 4
Python Functions, Classes, and
Modules
This chapter covers the following topics:
Python Functions: This section provides an overview of working
with and building Python functions.
Object-Oriented Programming and Python: This section
describes key aspects of using object-oriented programming
techniques.
Python Classes: This section provides an overview of creating and
using Python classes.
Working with Python Modules: This section provides an overview
of creating and using Python modules.
This chapter moves away from the basics introduced in
Chapter 3, “Introduction to Python,” and introduces
Python functions, classes, and modules. Building Python
functions allows for the creation of reusable code and is
the first step toward writing object-oriented code.
Classes are the Python tools used to construct Python
objects and make it easier to produce scalable
applications that are easy to maintain and readable.
Finally, this chapter introduces the wide world of Python
modules and how they can extend the capabilities of
Python and make your job of coding much easier.
“DO I KNOW THIS ALREADY?” QUIZ
The “Do I Know This Already?” quiz allows you to assess
whether you should read this entire chapter thoroughly
or jump to the “Exam Preparation Tasks” section. If you
are in doubt about your answers to these questions or
your own assessment of your knowledge of the topics,