Object Oriented Programming in Python


User defined data type where we give a name to the data type.

This data type can contain many variables indies of it with each variable possibly being of different data types, and each variable can have it's own name.

* A class must start with a capital letter.

Attributes (variable)

A variable inside a class

Methods (function)

You can have functions inside of a class. You call functions inside of a calls a mehtod.


An object is an instance of a particular class.


Pythons internal reference identifier for classes.

use self.color when declaring. Omnit when initalizing. You can then set it to an intialized class outside.

You MUST have self as the first argument of that funciton.

self allows for public vairables. If self is not infront of a method variable it is a private variable.

A void function doens't retrun anything.


Special type of method. Automatically run when a class is intialized.

two underscores def init():