Creating Classes and Methods
Read this for more on creating classes and methods.
Chapter 17 Classes and Methods
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
Source: Allen B. Downey, http://greenteapress.com/thinkpython2/html/thinkpython2018.html
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 License.