Introduction to Object-Oriented Programming in Python

Start Free Preview

Buying via our links supports this free directory · Affiliate disclosure.
Course facts
  • Payment: Free Preview (Paid Upgrade)
  • Learning style: Self-paced, start anytime
  • Format: Text & Interactive
  • Video access: Streaming Only
  • Before you start: Writing Functions in Python
DataCamp details
  • Chapters: 3
Created byDataCamp
Available onDataCamp

Course Details
Learning Style

Start Anytime

Level

Intermediate

Study Mode

100% Online

Duration

Short (< 10 Hours)

Languages
Audio Language

English

Outcomes
Certificate

Certificate of Completion

Price & Terms
Pricing Model

Free Preview (Paid Upgrade)

Technical
Content Medium

Text & Interactive

Video Access

Streaming Only

Specification
Access

Subscription

SKU: introduction-object-oriented-programming-python Category: Tags: , Brand:

Learn to write Python classes with constructors, build subclasses through inheritance, and add equality checks, string output and custom exceptions.

At a glance
Duration3 hrs
LevelIntermediate
CertificateCertificate of Completion
LanguageEnglish
AccessSubscription
Add your review
Add to wishlistAdded to wishlistRemoved from wishlist 0
Add to compare
Shorter version. This course shares most of its lessons with Object-Oriented Programming in Python, which adds a chapter on class design best practices.

Object-oriented programming in Python structures code around classes, which bundle data with the methods that act on it, as an alternative to purely procedural scripts. It helps you write cleaner, more reusable code. You define classes with attributes, methods and constructors, build subclasses that extend existing behavior, and make your own objects work with Python’s equality checks, string representations and exception handling.

What You Will Achieve

  • Write a Python class whose __init__ constructor assigns attributes when each object is instantiated.
  • Decide whether data belongs at class level or instance level, and add a class method that serves as an alternative constructor.
  • Create subclasses that inherit methods and attributes from a parent class and customize the behavior they receive.
  • Define equality and readable string output for your own objects, then raise and catch exception types you designed yourself.


Program Overview

Classes, Objects and Constructors

Introduces object-oriented programming, how it differs from procedural programming, and the parts that make up a class definition.

  • OOP terminology and how objects relate to classes
  • Attributes and methods inside a class
  • The __init__ constructor and its correct use
  • Building a class from scratch

Class Data, Inheritance and Polymorphism

Separates class-level from instance-level data and shows how subclasses reuse and adjust what a parent class defines.

  • Class attributes versus instance attributes
  • Class methods and alternative constructors
  • Creating and customizing subclasses
  • Inheritance of methods and class attributes

Object Comparison, String Representation and Exceptions

Connects custom classes to standard Python behavior for comparing objects, displaying them as text and handling errors.

  • Operator overloading for equality
  • Comparison across inherited classes
  • String representation of objects
  • Catching exceptions and defining custom ones

Certificate Awarded (Paid)


Job Outlook

Classes, inheritance and custom exceptions are used wherever Python code is organized into reusable parts, including software development, data engineering and the upkeep of larger Python projects.


Our take

Good for: Python learners ready to move their code into classes, who want short coding exercises on constructors, inheritance and custom exceptions.

Keep in mind: The chapters center on classes, inheritance, object comparison and exceptions; clean-code style and Pythonic conventions get no lessons of their own.

Bottom line: A tightly scoped set of exercises on writing classes, extending them through inheritance and making them fit in with standard Python behavior.

Frequently Asked Questions

How much of the course is spent writing code?

Many lessons are short coding exercises rather than explanations, such as creating your first class, adding a constructor, customizing a subclass and building a BetterDate class after a lesson on alternative constructors.

Where does the course teach class constructors?

The first chapter introduces the __init__ constructor, shows its correct use and then has you add one to a class, so that attributes are assigned at the moment an object is instantiated.

How are custom exceptions built in the final chapter?

They rely on inheritance. After lessons on catching exceptions, you define your own exception classes based on existing ones, which lets a program respond in a controlled way to unexpected inputs or states.

User Reviews

0.0 out of 5
★★★★★
0
★★★★★
0
★★★★★
0
★★★★★
0
★★★★★
0

No reviews yet. Be the first to review this course.

There are no reviews yet.

Write your review

Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.

×

    Report this page
    Introduction to Object-Oriented Programming in Python
    Introduction to Object-Oriented Programming in Python
    LiveTalent
    Logo
    Compare items
    • Total (0)
    Compare
    0