Hi all,
i am just learning about classes. This a very simplified version of the example i was checking in a book
i have read similar thread but in ost of them the user used only single underscore _init_ instead of double __init__
thanks in advance
i am just learning about classes. This a very simplified version of the example i was checking in a book
class Person: def __ini__(self, name): self.name = nameonce i try to create an instance from this class
person1 = Person('John')i get the following error :
Error:Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
person1 = Person('John')
TypeError: this constructor takes no arguments
can you please advise what is the problem here.i have read similar thread but in ost of them the user used only single underscore _init_ instead of double __init__
thanks in advance