M4: Classes and Objects

This module provides an introduction to Python classes and object-oriented programming.

Pre-recorded Lectures

The pre-recorded lectures are available through Canvas.

The lectures include a video to introduce the instructor and module (“Introduction”) and a series of 5-20 minute videos:

  • 4.0 - Introduction

  • 4.1 - Stacks

  • 4.2 - Queues

  • 4.3 - Class Construction, Attributes, and Methods

  • 4.4 - Private Attributes

  • 4.5 - Dunder Methods

  • 4.6 - Object-Oriented Modeling

  • 4.7 - Class Composition

Textbook Chapters

The chapters corresponding to this module are:

A PDF version of the textbook is also available here.

You will be asked to log in with your CNetID before you can see the textbook.

Please note that the pre-recorded lectures cover largely the same material as the book. We recommend starting with the pre-recorded lectures, and then reading through the book (but do not feel bad if you find yourself skipping large portions of the textbook, if you feel they tread on material that you already understood when watching the lectures)

Zoom Sessions

You will find the links to the Zoom sessions on Canvas.

  • Week 5
    • Wednesday, October 28th: Lab #4, Part 1

    • Friday, October 30th: Q&A and extended example

  • Week 6
    • Wednesday, November 4th: Lab #4, Part 2

    • Friday, November 6th: Q&A and extended example

Files from the M-D-1 example:

Lab

Lab #4: Classes and Objects

This lab is divided into two parts. We will be working through the first part in the October 28th lecture, and through the second part in the November 4th lecture. You are not expected to complete the lab before that lecture, but you should try to read through it so you are familiar with its contents.

Short Exercises

Short Exercises #4, due Sunday, Nov 8 at 3pm CST

Programming Assignment

Programming Assignment #4, due Friday, Nov 13 at 3pm CST