0
Why is this code not working
Everytime when i run the code the code doesnt print the area of the rectangle. idk why https://code.sololearn.com/c1qexlZKrUiW/?ref=app
9 Answers
+ 3
You should learn about indentation properly.
You are creating an instance of class Rectangle inside method area() .
And method area() is inside method __init__ .
Seriously,how did you even got to this point without understanding the most basic thing,i.e. "indentation" ?
+ 1
abpatrick catkilltsoi I already tried to change the code in solo learn but it still doent give me the output . I rewrote the code in pydroid 3(line by line) but it still doesnt give output.
0
Abhay i did already ident the code properly in pydroid but it still didnt output the answer but due to copying the code to the code playground my code seems uindented
0
Not area(rect), use rect.area() instead.
0
abpatrick catkilltsoi I did that too but it still doesnt print the output it jus says (Program Finished)
0
I did try your code. Output properly if you indented correctly.
0
But you haven't change your indentation.
0
abpatrick catkilltsoi i already have changed it it still doesnt give an output.I have ident it properly too
0
Please, review the examples in OOP and function part before you said that you are coding properly.