Skip to main content
Loading page…
Python Mastery
Chapter 12
Lesson 1 of 4
Classes & Instances
Contents
Notes
Tutor
Concept
What Is a Class?
Loading activity…
Previous
1 / 10
Continue
Contents
Notes
Discussion
Tutor
28 min
10 activities
0 of 10 done
In this lesson
1
What Is a Class?
2
The __init__ Method and self
3
BankAccount — A Complete Example
4
Quick Check: What Does __init__ Return?
5
Pitfall: Mutable Default Arguments in __init__
6
Build a Rectangle Class
7
Pro Tip: __repr__ is Your Best Debugging Friend
8
Heads Up: Dunder Methods Are a Deep Topic
9
Python Variables Are Names, Not Boxes
10
Explain self in Your Own Words
Objectives
Define a class with an __init__ method and meaningful instance attributes
Create multiple instances from a class and access attributes via dot notation
Define instance methods that read and mutate object state
Build a real-world BankAccount class with deposit and withdraw behavior
Chapter 12 · Object-Oriented Programming
Classes & Instances
Attributes, Methods & Encapsulation
Inheritance & super()
Designing with Objects
Previous: Unicode, Bytes & Encoding
Next: Attributes, Methods & Encapsulation