Processing math: 100%
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Engineering LibreTexts

17: Classes and methods

( \newcommand{\kernel}{\mathrm{null}\,}\)

Although we are using some of Python’s object-oriented features, the programs from the last two chapters are not really object-oriented because they don’t represent the relationships between programmer-defined types and the functions that operate on them. The next step is to transform those functions into methods that make the relationships explicit.

Code examples from this chapter are available from http://thinkpython2.com/code/Time2.py, and solutions to the exercises are in http://thinkpython2.com/code/Point2_soln.py.


This page titled 17: Classes and methods is shared under a CC BY-NC 3.0 license and was authored, remixed, and/or curated by Allen B. Downey (Green Tea Press) via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?