Skip to Content
Programming the Raspberry Pi, Third Edition: Getting Started with Python, 3rd Edition
book

Programming the Raspberry Pi, Third Edition: Getting Started with Python, 3rd Edition

by Simon Monk
June 2021
Beginner
208 pages
3h 50m
English
McGraw-Hill Education TAB
Content preview from Programming the Raspberry Pi, Third Edition: Getting Started with Python, 3rd Edition

5

Modules, Classes, and Methods

In this chapter, we discuss how to make and use our own modules, like the random module we used in Chapter 3. We also discuss how Python implements object orientation, which allows programs to be structured into classes, each responsible for its own behavior. This helps to keep a check on the complexity of our programs and generally makes them easier to manage. The main mechanisms for doing this are classes and methods. You have already used built-in classes and methods in earlier chapters without necessarily knowing it.

Modules

Most computer languages have a concept like modules that allows you to create a group of functions that are in a convenient form for others to use—or even for yourself to use on different ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Raspberry Pi 3 Cookbook for Python Programmers - Third Edition

Raspberry Pi 3 Cookbook for Python Programmers - Third Edition

Steven Lawrence Fernandes, Tim Cox
Getting Started With Arduino, 4th Edition

Getting Started With Arduino, 4th Edition

Massimo Banzi, Michael Shiloh

Publisher Resources

ISBN: 9781264257362