Your browser is ancient!
Upgrade to a different browser to experience this site.

Python Classes and Inheritance

4 Modules
20 Hours
5 hrs per module (approx.)
Rating

About Python Classes and Inheritance

This course introduces classes, instances, and inheritance. You will learn how to use classes to represent data in concise and natural ways. You'll also learn how to override built-in methods and how to create "inherited" classes that reuse functionality. You'll also learn about how to design classes. Finally, you will be introduced to the good programming habit of writing automated tests for their own code.

The course is best-suited for you if you are already familiar with Python fundamentals, which are covered in the "Python Basics" and "Python Functions, Files, and Dictionaries" courses (courses 1 and 2 of the Python 3 Programming Specialization). It is optional to have taken the "Data Collection and Processing with Python" course (course 3 of the specialization), but knowledge of retrieving and processing complex nested data is helpful.

This is the fourth of five courses in the Python 3 Programming Specialization.

Skills You'll Gain

  • Code Testing
  • Computer Programming
  • Debugging
  • Object-Oriented Programming (OOP)
  • Python (Programming Language)

What You'll Earn

Certificate of Completion:
Certificates of completion acknowledge knowledge acquired upon completion of a non-credit course or program.
Experience Type
100% Online
Format
Self-Paced
Subject
  • Data Science
  • Technology
Platform
Coursera
Welcome Message

Welcome to Python Classes and Inheritance, a course focused on object-oriented programming in Python. Learners explore classes, instances, inheritance, decorators, exceptions, and testing while developing well-structured, reusable code.
This abbreviated syllabus description was created with the help of AI tools and reviewed by staff. The full syllabus is available to those who enroll in the course.

Course Schedule

Module 1: Classes

  • Video: Introduction to the Specialization
  • Video: Welcome to Python Classes and Inheritance
  • Reading: Syllabus
  • Video: How to Use the Interactive Textbook
  • Reading: Help Us Learn More About You!
  • Reading: Syllabus
  • App Item: Single Sign On: Interactive Textbook and Practice Opportunities
  • Reading: Introduction: Classes and Objects - The Basics
  • Reading: Objects Revisited
  • Video: User-Defined Classes
  • Reading: User Defined Classes
  • Video: Adding Parameters to the Constructor
  • Reading: Adding Parameters to the Constructor
  • Video: Adding Other Methods to a Class
  • Reading: Adding Other Methods to a Class
  • Video: Instance Variable Search Order
  • Video: Example: Creating Instances from Data
  • Reading: Objects as Arguments and Parameters
  • Video: Converting an Object to a String
  • Reading: Converting an Object to a String
  • Video: Special (dunderscore) Methods
  • Video: Instances as Return Values
  • Reading: Instances as Return Values
  • Video: Sorting Lists of Instances
  • Reading: Sorting Lists of Instances
  • Video: Class Variables and Instance Variables
  • Reading: Class Variables and Instance Variables
  • Video: Thinking About Classes and Instances
  • Reading: Thinking About Classes and Instances
  • Reading: A Tamagotchi Game
  • Graded Assignment: Optional - What Did You Use to Practice This Week?
  • Graded: Assessment: Week One

Module 2: Inheritance

  • App Item: Single Sign On: Interactive Textbook and Practice Opportunities
  • Reading: Introduction: Class Inheritance
  • Video: Inheriting Variables and Methods
  • Reading: Inheriting Variables and Methods
  • Video: Overriding Methods
  • Reading: Overriding Methods
  • Video: Invoking the Parent Class's Method
  • Reading: Invoking the Parent Class's Method
  • Reading: Tamagotchi Revisited
  • Graded Assignment: Optional - What Did You Use to Practice This Week?
  • Graded: Assessment: Week Two

Module 3: Unit Testing and Exceptions

  • App Item: Single Sign On: Interactive Textbook and Practice Opportunities
  • Video: Introduction: Test Cases
  • Video: The test.testEqual Function
  • Reading: The test.testEqual Function
  • Video: Return Value Tests
  • Video: Side Effect Tests
  • Reading: Writing Test Cases for Functions
  • Video: Program Development with Test Cases
  • Reading: Program Development
  • Video: Testing Classes
  • Reading: Testing Classes
  • Video: Conclusion: Test Cases
  • Reading: What is an Exception?
  • Video: Exception Handling Flow-of-control
  • Reading: Exception Handling Flow-of-control
  • Reading: Raising and Catching Errors
  • Video: When to use Try/Except
  • Reading: When to use Try/Except
  • Video: Handling Different Exception Types
  • Reading: Standard Exceptions
  • Video: Introduction to Django
  • Video: How Django Uses Classes and Inheritance
  • Video: Introduction - Final Course Project
  • Reading: Course Feedback
  • Reading: Keep Learning with Michigan Online
  • Graded: Assessment: Test Cases
  • Graded: Assessment: Exceptions
  • Graded: Project: Wheel of Fortune
Grading Policy

Learners must complete all graded assessments. There are five graded assessments, each worth 20% of your final grade.

Course content developed by U-M faculty and managed by the university. Faculty titles and affiliations are updated periodically.

Intermediate Level

Some related experience required

Enrollment Options

Individuals

This experience is available to individual learners on the following platforms:

U-M Community

Students, faculty, staff, and alumni of the University of Michigan get free access.

Organizations

Special pricing and tailored programming bundles available for organizational partners.

What are Coursera and edX?

Michigan Online learning experiences may be hosted on one or more learning platforms. Platform features may vary, including payment models, social communities, and learner support.

Coursera

  • Hosts online courses, series, and Teach-Outs from Michigan Online
  • Enroll and preview courses anytime
  • May earn a non-credit certificate from Coursera

edX

  • Hosts online courses and series from Michigan Online
  • Many offer a free (limited) audit option
  • May earn a non-credit certificate from edX

For more information visit the What are Coursera and edX? FAQ section

Reviews and Ratings

4.7

2903 Ratings from Coursera

Michigan Online
For You

Sign up for a Michigan Online account to customize your experience!