Python Lab

Stage 2 · 35 min · Pro

Object-oriented programming: classes

Create a class, the __init__ constructor, attributes, methods, self, __str__ and creating several objects.

Objectives

This lesson is for Pro members

As a program grows, grouping related data and behaviour into one "template" keeps code easy to understand and extend. Most Python libraries (Django, pandas...) are built on classes.

See Pro plans Open in the app