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 trial

Python Object-Oriented Python (retired) Objects __init__

Ricardo Ortega
Ricardo Ortega
7,167 Points

Bumer? I can't solve the second task!

This is my code but I can't pass the challenge:

class Student: name="Ricardo" def init(self,name): self.name=name

student.py
class Student:
  name=""
  def __init__(self,name):
        self.name=name

2 Answers

Tomas Pavlik
Tomas Pavlik
26,726 Points

Hi Ricardo, you forgot to set the deault value of the name argument (def init(self, name="Ricardo") The rest is ok :-)

Ricardo Ortega
Ricardo Ortega
7,167 Points

Thanks Tomas I forgot to put the name on the init argument