Free Course Image Object-Oriented Programming OOP in Python: Classes, Inheritance and Polymorphism

Free online courseObject-Oriented Programming OOP in Python: Classes, Inheritance and Polymorphism

Duration of the online course: 5 hours and 25 minutes

New

Build real-world Python OOP skills fast: classes, inheritance, polymorphism, magic methods, and quizzes in a free course—level up your code and career.

In this free course, learn about

  • Core OOP concepts in Python: classes, objects, attributes, and instance creation
  • Class vs instance attributes, plus when to use @staticmethod and @classmethod
  • __dict__ and Python attribute lookup order (instance -> class -> bases)
  • Encapsulation with getters/setters and @property for computed/validated attributes
  • Readable object output with __str__ and __repr__ (incl. printing lists of objects)
  • Operator overloading and comparisons via magic methods like __add__, __mul__, __lt__
  • Using NotImplementedError to mark methods that must be implemented by subclasses
  • Modeling relationships with multiple classes; composition, aggregation, and dictionaries
  • Avoiding mutable default args (e.g., default empty list) in class relationships
  • Using Enum for constrained, named constant values (e.g., instructor designation)
  • Geometry OOP design: Points/LineSegments/Polygons; perimeter/area and intersection rules
  • Inheritance purpose and patterns: single, multilevel, and multiple inheritance
  • Method Resolution Order (MRO) and using super() correctly in inheritance chains
  • Abstract classes: using ABCs/abstract methods so a class cannot be instantiated

Course Description

Writing Python that scales is not just about making code work, it is about making it easy to extend, test, and maintain. This course helps you move from script-style programming to a clean object-oriented mindset by teaching how to design programs around well-structured classes and objects. You will practice turning real problems into reusable models, so your code stays readable even as projects grow.

You will start by building your first classes and understanding how objects and classes relate, then learn how Python actually stores and resolves attributes. Along the way, you will make your objects feel natural to use by implementing string representations and by working with computed attributes through property. You will also see when to use instance methods, class methods, and utility-style static methods so responsibilities stay clear and your design avoids unnecessary coupling.

As you gain confidence, you will step into encapsulation and controlled access with getters and setters, then learn polymorphism and operator overloading to make custom types interact smoothly with Python syntax. You will also explore comparisons, rich behavior through magic methods, and the role of NotImplementedError in defining contracts during development. These skills are essential when building libraries, frameworks, and team-friendly codebases.

The course then moves into modeling relationships between multiple classes, using patterns that prevent common pitfalls such as unsafe default parameters. You will work with structured representations like Enum, connect entities in a clear way, and see how dictionaries and keys can support practical object management. Challenges around polygons and geometry provide a hands-on way to practice organizing collaborating objects rather than writing tangled logic.

Finally, you will learn inheritance in depth, including method resolution order, super(), multilevel and multiple inheritance, and when inheritance is the wrong tool compared to composition. You will also be introduced to abstract classes to enforce consistent interfaces across related types. By the end, you will be prepared to design Python programs that are easier to evolve, with OOP choices that are intentional rather than accidental.

Course content

  • Video class: Lesson-01 | Introduction of Object-Oriented Programming | [OOP in Python] 16m
  • Exercise: Which statement best describes how objects and classes relate in Python OOP?
  • Video class: Lesson-02 | Creating Our First Class | [OOP in Python] 11m
  • Exercise: In Python OOP, which option correctly shows how to create an object from a class named Student?
  • Video class: Lesson-03 | Class Level Attributes | [OOP in Python] 04m
  • Exercise: In Python OOP, which method type is typically used when you want to create a utility function inside a class that does not depend on instance (self) or class (cls) data?
  • Video class: Lesson-04 | Attribute __dict__ | [OOP in Python] 10m
  • Exercise: When accessing an attribute like department on an object, what lookup order does Python generally follow?
  • Video class: Lesson-05 | Task 1 12m
  • Exercise: Why is the point’s magnitude implemented using the @property decorator instead of a fixed data attribute?
  • Video class: Lesson-06 | __str__ and __repr__ | [OOP in Python] 06m
  • Exercise: When printing a list of custom objects, which special method is used to get a readable representation for each element?
  • Video class: Lesson-07 | Class Method 05m
  • Exercise: Which type of method is decorated with @classmethod and receives cls as its first parameter to work with class-level attributes?
  • Video class: Lesson-08 | Accessing other class object in method | [OOP in Python] 06m
  • Exercise: In a Python class, which method type is most appropriate for setting a shared value like group_members that applies to all Student objects?
  • Video class: Lesson-09 | Data Encapsulation 06m
  • Exercise: In Python OOP, which concept allows a child class to reuse and extend the behavior of a parent class?
  • Video class: Lesson-10 | Getters, Setters 25m
  • Exercise: In Python OOP, what is the main purpose of using the @property decorator for an attribute like name?
  • Video class: Lesson-10 (Supp) | Naming Conventions for Getters and Setters | [OOP in Python] 10m
  • Exercise: In Python OOP, what is polymorphism best described as?
  • Video class: Lesson-11 | Polymorphism 06m
  • Exercise: In Python OOP, how can you make the + operator work with objects of your own class (e.g., combining two students or two lists of members)?
  • Video class: Lesson-12 | More Magic Methods | [OOP in Python] 17m
  • Exercise: When comparing two custom Student objects in Python (e.g., using < or >), what should you add to the class to make such comparisons work?
  • Video class: Lesson-13 | NotImplemented 14m
  • Exercise: In Python OOP, what is the main purpose of raising NotImplementedError inside a method?
  • Video class: Lesson-14 | Task 3 13m
  • Exercise: In a Python Point class, what should the __mul__ method return when multiplying two Point objects (Point * Point)?
  • Video class: Lesson-15 | Multiple Classes 07m
  • Exercise: When modeling a relationship between two classes (e.g., a Book that has Authors), what is a better approach than using a default empty list as a parameter?
  • Video class: Lesson-16 | Enumeration Class | [OOP in Python] 12m
  • Exercise: Why is an enumeration (Enum) class used for an instructor's designation instead of a plain list of valid strings?
  • Video class: Lesson-17 | Multiple Classes Finalized | [OOP in Python] 17m
  • Exercise: How does the program create a link between subjects and the instructors/students associated with them?
  • Video class: Lesson-18 | Multiple Classes Demo (CSV Files) | [OOP in Python] 14m
  • Exercise: Which OOP concept is being used when a Student class is linked to a Department class and each student is stored using a registration number as a key in a dictionary?
  • Video class: Lesson-19 | Challenge-I (Area and Perimeter of Polygon)| [OOP in Python] 14m
  • Exercise: How should the perimeter of a polygon be computed in an OOP design using Point and LineSegment classes?
  • Video class: Lesson-20 | Challenge-II (Area and Perimeter of Any Polygon)| [OOP in Python] 08m
  • Exercise: When detecting whether a polygon is complex (self-intersecting), which pair(s) of edges should be excluded from intersection tests?
  • Video class: Solution of Challenge-I and II (Type and Area and Perimeter of Any Polygon)| [OOP in Python] 20m
  • Exercise: In Python OOP, what is the main purpose of inheritance?
  • Video class: Lesson-21 | Class Inheritance or Subclasses | [OOP in Python] 10m
  • Exercise: In Python inheritance, which statement about parent (Employee) and child classes (Instructor/AdminStaff) is correct?
  • Video class: Lesson-22 | Method Resolution Order 11m
  • Exercise: In Python OOP, what is the main purpose of using super() in a child class?
  • Video class: Lesson-23 | Multi Level Class Inheritance 09m
  • Exercise: In multilevel inheritance in Python, which statement best describes the relationship between classes?
  • Video class: Lesson-24 | Multiple Inheritance 08m
  • Exercise: What does multiple inheritance mean in Python OOP?
  • Video class: Lesson-25 | Multiple Inheritance (Part-02) 06m
  • Video class: Lesson-26 | Class Inheritance Example 02m
  • Exercise: In the Pokémon-style example, why is using inheritance beneficial when there are many different Pokémon types?
  • Video class: Lesson-27 | Composition and Inheritance 02m
  • Exercise: When designing a Python OOP program, what is the key idea behind choosing composition over inheritance?
  • Video class: Lesson-28 | Abstract Class 11m
  • Exercise: In Python, what must be true for a class to behave as an abstract class that cannot be instantiated?

This free course includes:

5 hours and 25 minutes of online video course

Digital certificate of course completion (Free)

Exercises to train your knowledge

100% free, from content to certificate

Ready to get started?Download the app and get started today.

Install the app now

to access the course
Icon representing technology and business courses

Over 5,000 free courses

Programming, English, Digital Marketing and much more! Learn whatever you want, for free.

Calendar icon with target representing study planning

Study plan with AI

Our app's Artificial Intelligence can create a study schedule for the course you choose.

Professional icon representing career and business

From zero to professional success

Improve your resume with our free Certificate and then use our Artificial Intelligence to find your dream job.

You can also use the QR Code or the links below.

QR Code - Download Cursa - Online Courses

More free courses at Programming Languages ( Python, Ruby, Java, C )

Free Ebook + Audiobooks! Learn by listening or reading!

Download the App now to have access to + 5000 free courses, exercises, certificates and lots of content without paying anything!

  • 100% free online courses from start to finish

    Thousands of online courses in video, ebooks and audiobooks.

  • More than 60 thousand free exercises

    To test your knowledge during online courses

  • Valid free Digital Certificate with QR Code

    Generated directly from your cell phone's photo gallery and sent to your email

Cursa app on the ebook screen, the video course screen and the course exercises screen, plus the course completion certificate