Everything in Python is an object
Hearing that phrase is very common, but understanding it, really understanding it, is something else.
This tutorial goes through how to build classes to understand object-oriented programming and how it applies to the Python data model.
In particular the tutorial covers:
- Introduction to OOP
- Building a class for a
Deck
of cards - Class methods
- Dunder methods
- Better integration] using eading underscores
- Parent and child classes
Extras:
- Mutability
- Using
__getitem__
and__setitem__
- Protected and "private" variables
This tutorial is inspired by the book
Fluent Python (second edition) by Luciano Ramalho (O'Reilly). Copyright 2022 Luciano Ramalho