I saw this code while learning how to add key:value pairs in a hashtable/Dictionaries. I couldn't understand the need and use of calling super().__init()
in the constructor. Can someone pls help me out.
class MyDictionary(dict):
# __init__ function
def __init__(self):
super().__init__()
self = dict()
# Function to add key:value
def add(self, key, value):
# Adding Values to dictionary
self[key] = value