sir, when I am using class directly as an abstract class, the code is giving an error. It quote" missing 1 required positional argument: ‘self’ ".
Python Class 02
hey @palashrai31 ,
can you please your snippet here or a link to it.
I am unable understand it.
Thank You
.
class Person: name=“palash” def say_hi(self): print(“hello world”,self.name)
you might be calling it like
Person.say_hi()
in this way , Person is not created as an object of that class , its a simple reference .
You can see this by printing Person.
To work properly ,
you need to call it as Person().say_hi()
In this way an object is created and hence , self is provided by that particular object .
okay , I got it, thank you !
Its good to hear that.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.