13OBJECT-ORIENTED PROGRAMMING

image

So far in this primer, you’ve been writing code using procedural programming techniques built around performing actions and evaluating logic. You’ve learned how to organize code using functions and modules, and you’ve used built-in data types to organize data. In this chapter, you’ll learn how to use object-oriented programming to define your own types to organize both code and data.

Object-oriented programming (OOP) is a language model that lets you bundle together related data with functionality that acts on that data. The data consists of attributes (akin to variables) that are manipulated by methods (akin to functions). ...

Get Python Tools for Scientists now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.