Would appreciate some feedback on my project! Get_shape_inside was quite tricky but I got it in the end.
There isn’t a link or any code in your post.
Hello @craig.lunney , I fixed it. See if it works now. Thanks for the heads-up!
I can see your code now, it looks absolutely spot on easy to follow and passes all the tests.
Hi @craig.lunney sorry to object, but it does not really. The get_shape_inside method returns correct results only with certain parameters( including those in the project description), but not all! for eg. when tested with the following:
rect = Rectangle(25, 8)
sq = Square(2)
small_rect = Rectangle(10,5)
it returns 48 and 2, instead of 50 and 4 respectively.
@Renato here are some suggestions if you don’t mind:
- The “else” part of your “get picture method”(6 lines of code) could also be done in a single line:
- The amount_inside is literally the area of the instance object // that of the passed object.
area_int = shape.w * shape.h
area_ext = self.w * self.h
that’s 18 blocks of code replaced with 4 and returns correct value each time!