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

Proper Properties Object-Oriented Python Help

Hi, I may be missing what the question is looking for in part two. It seems rather straightforward. Thanks for the help!

rectangle.py
class Rectangle:
    def __init__(self, width, length):
        self.width = width
        self.length = length

    @property
    def area(self):
        return self.width * self.length

    @property
    def perimeter(self):
        return ((self.width * 2) + (self.length * 2))

I was but now it seemed to work... thanks for confirming!

Louise St. Germain
Louise St. Germain
19,424 Points

No problem - glad it worked out!

2 Answers

Louise St. Germain
Louise St. Germain
19,424 Points

Are you getting an error? I went to the challenge and copied your code from above into the challenge, and it passed.

Eric M
Eric M
11,546 Points

Moving this to an answer and marking as best so that this doesn't look like an unresolved 0 answer question to anyone looking to help out.

Mohit N Rajput
Mohit N Rajput
2,827 Points

All code is fine,it is not run in browser some time beacause of some browser's editor indentaion, so if you get error again ident the all code and run