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

20th Aug 2022, 11:42 AM
Programming_C#
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" ?
20th Aug 2022, 11:45 AM
Abhay
Abhay - avatar
+ 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.
20th Aug 2022, 12:38 PM
Programming_C#
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
20th Aug 2022, 11:59 AM
Programming_C#
0
Not area(rect), use rect.area() instead.
20th Aug 2022, 12:27 PM
abpatrick catkilltsoi
abpatrick catkilltsoi - avatar
0
abpatrick catkilltsoi I did that too but it still doesnt print the output it jus says (Program Finished)
20th Aug 2022, 12:31 PM
Programming_C#
0
I did try your code. Output properly if you indented correctly.
20th Aug 2022, 12:33 PM
abpatrick catkilltsoi
abpatrick catkilltsoi - avatar
0
But you haven't change your indentation.
20th Aug 2022, 12:54 PM
abpatrick catkilltsoi
abpatrick catkilltsoi - avatar
0
abpatrick catkilltsoi i already have changed it it still doesnt give an output.I have ident it properly too
20th Aug 2022, 1:19 PM
Programming_C#
0
Please, review the examples in OOP and function part before you said that you are coding properly.
20th Aug 2022, 1:23 PM
abpatrick catkilltsoi
abpatrick catkilltsoi - avatar