Python Classes and Inheritance
Course outline and certification by University of Michigan
Certification offered by
The mission of the University of Michigan is to serve the people of Michigan and the world through preeminence in creating, communicating, preserving and applying knowledge, art, and academic values, and in developing leaders and citizens who will challenge the present and enrich the future.
Key Points About This Course
Duration: 3 Days
Public Class Fee: RM 3,500
Virtual Class Fee: RM 2,975
This course introduces classes, instances, and inheritance. You will learn how to use classes to represent data in a 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.
Part 1: Classes
In this module, lectures and activities from the Runestone textbook will cover more complex data structures. By the end of this week, you will have learned how to process json formatted data, traverse nested data using nested iteration, and extract values from nested data.
- Introduction: Classes and Objects – The Basics
- Welcome to Python Classes and Inheritance
- Objects Revisited
- User-Defined Classes
- Adding Parameters to the Constructor
- Adding Other Methods to a Class
- Instance Variable Search Order
- Example: Creating Instances from Data
- Objects as Arguments and Parameters
- Converting an Object to a String
- Special (dunderscore) Methods
- Instances as Return Values
- Sorting Lists of Instances
- Class Variables and Instance Variables
- Thinking About Classes and Instances
- A Tamagotchi Game
Part 2: Inheritance
Part 3: Unit Testing and Exceptions
- Introduction: Test Cases
- The test.testEqual Function
- Return Value Tests
- Side Effect Tests
- Program Development with Test Cases
- Testing Classes
- Writing Test Cases for Functions
- Conclusion: Test Cases
- What is an Exception?
- Exception Handling Flow-of-control
- Raising and Catching Errors
- When to use Try/Except
- Standard Exceptions
- Handling Different Exception Types
- Introduction to Django
- How Django Uses Classes and Inheritance