pyhton constructor name code example
Example 1: python class constructor
class Human:
def __init__(self, name):
self.name = name
h1 = Human("Bob")
print(h1.name) # prints Bob, the name passed from constructor
Example 2: pyhton constructor name
class book :
def __init__(self):
self.name="Khan"
B=book()
print(B.name)