Classes and objects
Lesson 19 of 20 · Py.Micro
Bundle data and the functions that act on it into your own type.
class Account: defines a new type. __init__ runs when an object is created and stores its data in self.
Check yourself
When does __init__ run?
Do it in the browser: a real Python tool, a short mission and instant feedback. No install.
Start this lesson — free