Object-Oriented PythonClasses, __init__, and self
All courses

Objects: data + behavior, bundled

class defines a type. __init__ initializes instances. self is the instance — always the first parameter (Python won't let you forget, unlike some languages).

Quirk: Everything in Python is an object, including functions and classes. type(type) is type. The snake eats its tail.

Output
Press Run to execute your code.