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
  • Computer Science
  • Education
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

Free access is only available to current U-M students, alumni, faculty, and staff.

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

Most Recent Reviews

Read all reviews
The interactive learning with Runestone environment and jupyter notegook is very effective and very useful.
Lovely course, and great instructors. I recommend it for all.
I learnt a lot but modules 3 and 4 felt rushed. A lot of content but not enough practice questions. i don't feel like i will retain as much knowledge as the previous two courses. but overall really good course. enjoyed a lot
I have taken other Python courses that teach classes, however I still learned stuff in this course that I did not know before. I found I was generally confused about how "self" works in terms of methods inside of a class, & I feel like after taking this course I finally understand. While I don't understand decorators & wrapper functions that well this was my first time learning it, so I suspect that after I take other courses that go over those I'll similarly grow to understand that. My knowledge of class inheritance, super/parent class & sub/child classes has increased quite a bit after taking this course. While I don't fully understand them this was the first course I've taken that has actually gone over *args & **kwargs. So when I run into those in the future I can come back to videos/write ups in this course to solidify my understanding further. I have only dabbled in Visual Studio & the Way of the Programmer portion in Module 4 that went over using break points that certain IDEs have is definitely something I will take advantage of in the future. I would recommend this course for anyone that has surface level knowledge of classes/inheritance & wants to gain a deeper understanding of those. Or if you just have some Python knowledge & want to learn about classes, this is a good course to take to learn that.
A lot of useless content.
PUTANGINA NYO
everything is easy, but the final project is too hard, Not because of my skill We must follow how question makers think to build up the whole project. If we can build it from nothing, it would be much easier. I mean... there are thousands of ways to build a program, and everyone has a different way of getting the same result.. but this course just let you go one way
Great material but very unclear instructions for the last Assesment. Some of the code was prewritten and some of the code you had to write yourself. It was not clear what logic is already there and what not. I think it would be much better if you would write the whole thing from scratch by yourself
a lot could be improved. The readings are repeating themselves and the unit testing section wasn't enough
This is a great class but the Runestone practice website is down way too often (several hours for several times a week as well as many nights and most week-ends). Those are the times when I can practice. Please get serious and keep your servers running. PS: this is not a login issue. I authenticate from Coursera all the time.

Michigan Online
For You

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