Heshan Kumarasinghe
Heshan Kumarasinghe

Reputation: 83

Why is the following code in Python about subclasses throw an error?

I am a beginner in Python and have been coding along with a youtube video about classes, inheritance and subclasses. However, when I typed the following code and ran it, it threw and error even though my code has been identical to the instructor in the youtube. Can someone help me understand what is wrong with the code? (Both a picture of the code and the error is shown below)

(the link to the youtube video I watched is - https://www.youtube.com/watch?v=RSl87lqOXDE&list=PL-osiE80TeTsqhIuOqKhwlXsIBIdSeYtc&index=4)

Code I ran

Error I got

Upvotes: 0

Views: 488

Answers (1)

dnishiyama
dnishiyama

Reputation: 101

I believe the issue is that you have a typo in the Developer __init__ function. You have spelled it __inti__

That explains why it is asking for a different number of arguments. It can't find an __init__ function for Developer so it is using the Employee's __init__.

Upvotes: 1

Related Questions