def __init__(self, attr1, attr2):
attr1 = attr1
attr2 = attr2
def __init__(attr1, attr2):
attr1 = attr1
attr2 = attr2
def __init__(self, attr1, attr2):
self.attr1 = attr1
self.attr2 = attr2
def __init__(attr1, attr2):
self.attr1 = attr1
self.attr2 = attr2
Correct Answer:
def __init__(self, attr1, attr2):
self.attr1 = attr1
self.attr2 = attr2
Explanation: When instantiating a new object from a given class, the __init__() method will take both attr1 and attr2, and set its values to their corresponding object attribute, that’s why the need of using self.attr1 = attr1 instead of attr1 = attr1.