Hello
I have written a very simple program to create an instance in Python. my code is as follows.
But I am getting TypeError like bellow
Traceback (most recent call last):
File "test_class.py" , line 4, in <module>
sarah = Athlets("Sarah" )
TypeError: this constructor takes no arguments
please help
thanks
I have written a very simple program to create an instance in Python. my code is as follows.
Code:
class Athlets: def _init_(self,a_name): self.name=a_name sarah = Athlets("Sarah") print(sarah)
But I am getting TypeError like bellow
Traceback (most recent call last):
File "test_class.py" , line 4, in <module>
sarah = Athlets("Sarah" )
TypeError: this constructor takes no arguments
please help
thanks
Comment