Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMUZ140127 Munyaradzi Muduka
10,337 Pointschallenge task 2 of 2
Override init in Student. Give init a name keyword argument with a default value of your choice. Set self.name equal to the name argument.
class Student:
def _init_ (self, name):
self.name= 'munyaradzi'
def noun(self):
return self.name
2 Answers
Robert Richey
Courses Plus Student 16,352 PointsHi there,
Great job getting this far!
After task 1, your code should look like this:
class Student:
name= 'munyaradzi'
Then, for task 2:
Override init in Student. Give init a name keyword argument with a default value of your choice. Set self.name equal to the name argument.
class Student:
name= 'munyaradzi'
def __init__(self, name="your choice"):
# Set self.name equal to the name argument.
Hope this helps,
Cheers
MUZ141033 Wimbayi Nyamundanda
893 Pointsmine is not working. its saying object() takes no parameters
class Student: name = "Kennedy" def init(self, name = "Kennedy"): self.name = name
Daniel Dugan
16,904 PointsLikely an indentation problem. class Student: name = "Kennedy"
def init(self, name = "Kennedy"): self.name = name
MUZ140127 Munyaradzi Muduka
10,337 PointsMUZ140127 Munyaradzi Muduka
10,337 Pointshie Robert ,thank you so much it worked. cheers