Have codes exactly like what the teacher shows but can't make it work
I wrote the codes exactly like what was shown to us in the video. However there is an error in the console after running the code "steve = Patient...". See below:
steve = Patient('Steven Hughes', 48)
TypeError: Patient() takes no arguments
Thanks.
2 answers ( 0 marked as helpful)
Hey Christine,
Thank you for your question!
If you have copied the code exactly as it is in the video, then you should have no problem running it. Make sure that you have defined your __init__
function properly, namely:
def __init__(self, name, age):
...
Kind regards,
365 Hristina
you need to use two underscore instead of one with the init function so it's going to be
__init__ instead of _init_