Object-Oriented Programming with Python

Summary

Object-oriented programming is at the heart of Python, and in this course we'll work on demystifying OOP and how to code in an OO fashion. We'll cover topics such as inheritance and encapsulation and get at the core of what Python programming is about. You'll be challenged to design and debug several non-trivial OO programs. After this course, you should know: classes and objects, instance variables, class variables, instance methods, class methods, static methods, class inheritance, mix-ins, working with collaborator objects, and many other basic OO concepts.

Major Topics

  • Classes and Objects
  • Inheritance and Mix-ins
  • Polymorphism and Encapsulation
  • Class vs. instance vs. static methods and variables
  • Working with object-oriented code
  • Design considerations when working with OOP
  • Object "truthiness"
  • Object equivalence
  • Customizing operators in Python
  • Debugging OO code
  • Reading OO code
  • Working with collaborator objects
  • Using CRC cards to guide design
  • A variety OO exercises
  • Several large OO projects

Phase

Programming and Back-end Development

Detailed Syllabus

OO Readings

  • OO Python Book
  • Other OO Resources
  • Attributes and Properties

Object-Oriented Programming

  • Polymorphism and Encapsulation
  • Collaborators
  • Mix-Ins
  • Project: OO Rock Paper Scissors
  • Pylint OO RPS
  • Coding and Design Tips
  • CRC Cards
  • RPS Bonus Features
  • Problem Sets
  • Exercises

More OO Python

  • Equality
  • Custom Operators
  • Properties
  • Variable Scope
  • Inheritance and Variable Scope
  • Exceptions
  • Problem Sets

OO Practice Problems

  • Easy 1
  • Easy 2
  • Medium 1
  • Hard 1

Slightly Larger OO Programs

  • Project: OO Tic Tac Toe
  • OO TTT Bonus Features
  • Project: OO Twenty-One
  • Exercises