I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
Hey @nayankoshiya ,
I guess this method is responsible for the error that you’re facing. I think you need to set the value of newside with the methods set_width and set_height as below:
Hi @nayankoshiya
There were two minor errors in your code that were causing the problem. One was a logical error and another was a syntactical error on lines number 35 and 52 respectively.
Below is a screenshot:
The reason you need to put greater than equal to because you can accommodate another shape even if the area is equal and that makes the termination condition. The syntax error is self-explanatory.
After fixing those errors your code was running all good. Below is a screenshot which shows that it passed all the test cases.
Thanks a lot…often silly things. However, I would like to understand the last solution. i often confused how to use or call Methods and variables defined inside a class.
when we say “.format( self.width)” which line in the code it will refer to…?