+ 2

Where am I going wrong here?

It keeps giving me a type error from the second definition under the class. I'm new to Python and I don't understand why. I've tried the pieces of code independent of each other and they worked. So where am I going wrong? please feel free to criticize as much as needed. I need to learn! https://code.sololearn.com/cR8FaaFt10Uh/?ref=app

31st Jan 2018, 8:15 PM
Thomas Slack
Thomas Slack - avatar
2 Réponses
+ 2
I updated the code and fixed it. The problem was I needed to change self.name to a string and the input into and integer. Also got rid of the Stu function as it served no purpose.
1st Feb 2018, 3:55 AM
Thomas Slack
Thomas Slack - avatar
0
The output of the stu() function is None. That's why self.name is also None.
31st Jan 2018, 8:36 PM
SplittyDev
SplittyDev - avatar