python what is super init code example
Example 1: python super init
class test:
def __init__(self, *args):
print(f"called test with: {args}")
class testing(test):
def __init__(self, *args):
print(f"Called testing with: {args}")
super().__init__(*args)
testing("hmm")
# super is a keyword that calls the parent class
Example 2: python super
class Square(Rectangle):
def __init__(self, length):
super().__init__(length, length)