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!

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__

object-oriented . Python. 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.

my answer

def _init(self, name = "John": self.name = name

class Student:
  name = 'Kennedy'

  def _init_(self, name ='store'):
    self.name = name

1 Answer

Chris Freeman
Chris Freeman
Treehouse Moderator 68,404 Points

The __init__ should have two underscores before and two after the word init