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 trialAshmit Pathak
4,441 Pointsplz tell what's going wrong in this code
i'am not able to solve plz tell what's going wrong
class Rectangle:
def __init__(self, w, l):
self.w = w
self.l = l
@property
def area(self):
return self.w*self.l
@property
def perimeter(self):
return l * 2 + w * 2
1 Answer
Jennifer Nordell
Treehouse TeacherHi there, Ashmit! You are doing great, but you forgot something in the perimeter function that you didn't forget in the area function. Remember that length and width are properties on the object. Just as you specified self.l
and self.w
in the area function, you will need to reference them that way in the perimeter
method.
Hope this helps!
Ashmit Pathak
4,441 PointsAshmit Pathak
4,441 Pointssorry ma'am i 'am not able to do that can you plz help me some more
Ashmit Pathak
4,441 PointsAshmit Pathak
4,441 Pointsthanx ma'am i understood