you need to implement some special methods - e.g. __str__ and/or __repr__
class Employee: def __init__(self, first, sal): self.first = first self.sal = sal def __str__(self): return 'Employee {}, salary {}'.format(self.first, self.sal) employee = Employee('rahul', 10000) print(employee)
Output:Employee rahul, salary 10000
Read this https://stackoverflow.com/a/2626364/4046632 for some more information and explanation.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs