Class Definition

Flash and JavaScript are required for this feature.

Download the video from iTunes U or the Internet Archive.

Description: This in-class question demonstrates class definitions in Python.

Instructor: Dr. Ana Bell

The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To make a donation or view additional materials from hundreds of MIT courses, visit MIT OpenCourseWare at ocw.mit.edu.

PROFESSOR: So, which of the following is a good and valid definition for a class representing a car? OK, most of the people I think have gotten it, which is the red, which says class car object, and that's perfect. OK.

So this defines a function, this defines a class correctly, but A is just not descriptive name at all, and this is kind of weird, and this is the right one here.

Free Downloads

Video


Caption

  • English-US (SRT)