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 Advanced Objects Proper Properties

plz tell what's going wrong in this code

i'am not able to solve plz tell what's going wrong

rectangle.py
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
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi 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! :sparkles:

sorry ma'am i 'am not able to do that can you plz help me some more

thanx ma'am i understood