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 trialDustin Wahba
13,362 Pointswhat am i doing wrong?
class Student: name = 'Dustin' def init(self, name): self.name = name
class Student:
name = 'Dustin'
def __init__(self, name):
self.name = name
2 Answers
Dan Johnson
40,533 PointsYour code will run fine but the challenge expects the name argument of __init__
to have a default value (It can be whatever you want).
Dustin Wahba
13,362 Pointsthank you
Dustin Wahba
13,362 PointsDustin Wahba
13,362 PointsThanks Dan. I'm new to the site and couldn't find where other people were asking questions. Then I figured out how to search the forum and found someone who was having a similar problem and was able to figure out that the initialization had to happen within the arguments list (or maybe its an argument tuple?). and was able to move on. but it was driving me crazy!! haha thanks again for your help and quick reply though!
Dustin Wahba
13,362 PointsDustin Wahba
13,362 Pointsi think i might have answered my tuple question though, the arguments to a function cannot be a tuple because assignment is invalid within a tuple. Is this logic correct?
Dan Johnson
40,533 PointsDan Johnson
40,533 PointsArguments to a function or method aren't necessarily a tuple, the parentheses in this case just list out the arguments (or lack of).
Passing in tuples would look like this:
zip((1,2,3), ('a','b','c'))