TypeError: Patient() takes no arguments
I tried running this and got an error message.
class Patient(object):
def _init_(self,name,age):
self.name = name
self.age = age
steve = Patient('Steven Hughes', 48)
the error message is below:
steve = Patient('Steven Hughes', 48)
TypeError: Patient() takes no arguments
1 answers ( 0 marked as helpful)
Hey Pius,
Thank you for reaching out!
Please, note that the __init__
function is defined with two underscores on both sides instead of one. Once this is corrected, you shouldn't experience any problems.
Kind regards,
365 Hristina