Defining Classes

The following is a new data type representing fractions.

Classes can be seen as parts of the English language. Class itself represents some noun, the methods in a class are verbs.

Calling the class Constructor

Also known as "instantiation"

Looking inside the object

Fraction Display

After __repr__ was defined

After __str__ was define

It now takes over the function of converting an object to a string when it is printed.