0

How to solve : "TypeError: __init__() missing 1 required positional argument"

class Employee: def __init__(self, name): self.name = name def emp_dtl(self): self.name = 'XYZ' def disp_emp_dtl(self): print(self.name) employee = Employee() employee.disp_emp_dtl

4th Mar 2021, 6:50 AM
Mohammed Shahariar Jawad
Mohammed Shahariar Jawad - avatar
1 Answer
+ 4
You need to pass a value to Employee() employee = Employee("George") You have a positional parameter name that needs an argument passed for it.
4th Mar 2021, 6:53 AM
ChaoticDawg
ChaoticDawg - avatar