Chapter four introduces concepts from Object-Oriented Programming (OOP). The chapter describes what an object is and how objects are used in Python programming. Objects are so integral to Python that readers are actually introduced to OOP starting in the first chapter, but chapter four is more intentional about understanding the OOP paradigm.
The chapter introduces OOP to the reader by introducing turtle graphics programming. Learning turtle graphics is both fun and challenging with instant feedback available from the graphics that the reader programs. OOP is further emphasized by learning to read XML files. XML files are formatted data files with a structure that can be parsed using an XML parser. Readers learn what a parser is and how to use it to parse XML files.
Finally, XML processing and turtle graphics are combined to plot exercise data captured from an exercise computer, tying the use of OOP in XML processing and graphics programming together. In addition, dictionary objects in Python are also introduced as the last built-in data type covered in the text.
KeywordsMaximum Heart Rate Accessor Method Practice Problem Workout Data Mutator Method
- 2.David Flanagan and Yukihiro Matsumoto. The ruby programming language. O’Reilly, Sebastopol, CA, 2008. Google Scholar
- 10.Guido van Rossum. Guido’s personal home page, 2010. [Online; accessed 1/29/2010; http://www.python.org/~guido/].
- 14.Wikipedia. Logo (programming language), 2010. [Online; accessed 1/29/2010; http://en.wikipedia.org/wiki/Logo_(programming_language)].