Python 2 vs. Python 3

Let's find out the differences between Python 2 and 3.

Implementation in Python2

Let’s start by looking at a regular class definition. Then we’ll add super using Python 2 to see how it changes.

Press + to interact
class MyParentClass(object):
def __init__(self):
pass
class SubClass(MyParentClass):
def __init__(self):
MyParentClass.__init__(self)

This is a pretty standard set up for single inheritance. We have a base class and then ...

Access this course and 1400+ top-rated courses and projects.