Object-Oriented Programming in Python

Design and build Python classes to create objects that store data, perform tasks, and work together.

14 Lessons140 Exercises

Classes

Updating Attributes

Methods

Updating with Methods

Returning Values

Level Review

Planning a Class

Building State

Reporting State

Helper Methods

Level Review

Predicting with Bigrams

A Bigram Model Class

Composition

Delegation

Collaboration

Level Review


Course description

In this course you will learn object-oriented programming in Python by building classes that store data, define behavior, and collaborate to solve complex problems. Starting with the basics of classes, instances, and attributes, you will progress to writing methods, controlling state changes, and planning class designs before writing code. As an application, you will build and connect multiple classes using composition and delegation, culminating in an AI agent that analyzes text data and generates responses to user queries using a bigram model.


Topics covered

  • Classes and Instances
  • Updating Attributes
  • Writing Methods
  • Updating State with Methods
  • Returning Values from Methods
  • Planning a Class
  • Building Up State
  • Reporting State
  • Helper Methods
  • Predicting with Bigrams
  • Designing a Bigram Model
  • Composition
  • Delegation
  • Collaboration

Prerequisites and next steps

This is a great course if you're comfortable writing Python programs with functions, loops, and dictionaries. Use it to learn object-oriented programming — a powerful approach to organizing code that is used across software development, data science, and AI.