O'Reilly logo

Python: Visual QuickStart Guide, Second Edition by Toby Donaldson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Object-Oriented Programming

In this chapter, we will briefly look at object-oriented programming, or OOP for short. OOP is a methodology for organizing programs that encourages careful design and code reuse. Most modern programming languages support it, and it is has proved to be a practical way to structure and create large programs.

We’ve already been using objects in Python; numbers, strings, lists, dictionaries, files, and functions are all examples of objects.

To create new kinds of objects, you must first create a class. A class is essentially a blueprint for creating an object of a particular kind. The class specifies what data and functions the objects will contain, and how they relate to other classes. An object encapsulates ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required