Scientific Computing with Python Projects - Polygon Area Calculator (Already solved)

(Already solved the issue)


I am about to finish this task but I am very puzzled as I run the test on replit and the tester is writing that my answer 2 != 6 but when I replicate the test on VScode with the same source code I get a 6 which is the correct answer.


Below is the code I am using for this method:

def get_amount_inside(self, shape):
space = self.height
shape_height = shape.height
amount = 0

while space > shape_height:
    right_space = self.width
    while right_space > shape.width:
      right_space -= shape.width
      amount += 1
    space -= shape.height 

return amount

Does anyone know what could be wrong?
Thank you!

Test is using square with side of size 5.

1 Like

Thanks I already found the issue. was missing the =