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 trialBashir Orfani
13,170 PointsRemove pass from the body
Remove pass from the body of the Double class. Define the new method. The new method should accept self and one argument. Convert the argument to an int and return it.
class Double(int):
def __new__(self):
self = int.__new__(self.)
self = self[::-1]
return self
4 Answers
Steven Parker
231,275 PointsThe task 2 instructions say "The new method should accept self and one argument.", but the code here accepts only "self". You need another parameter to accept the argument.
Then, once you have it, the rest of the instructions say "Convert the argument to an int and return it.". You won't need to do anything with "self".
Bashir Orfani
13,170 Pointsstill i didnt get it
Steven Parker
231,275 Points def __new__(self): # <-- how many arguments besides "self" will this take?
Bashir Orfani
13,170 Pointsone arguments
Steven Parker
231,275 PointsIf see that function taking an argument other than "self", what's the name of the parameter that will hold the argument?
Bashir Orfani
13,170 Pointsthank you Steven i got it.
Steven Parker
231,275 PointsBashir Orfani — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!