15,998,052 members
See more: , +
I have made a program, which calculates the area of Circle, Square and Triangle. The code is working if i press "run" command in Pychram. But when i upload it to git i get an email, that shows, the code is completely incorrect.

The code:
"""Ask user a shape and a radius or a side length and calculate the shape area."""

from math import pi, sqrt
Kujund = input("Please insert geometric shape:")
if Kujund == "Circle":
Pindala1 = pi * r_float ** 2
Vastus = round(Pindala1, 2)
print(Vastus, "cm^2")

elif Kujund == "Square":
Pindala2 = k_int**2
print(Pindala2, "cm^2")
elif Kujund == "Triangle":
Pindala3 = sqrt(3) / 4
Vastus1 = round(Pindala3, 2)
print(Vastus1, "cm^2")
else:
print("Shape is not supported.")

The email i get:
Style conventions checker results:

PEP8 stylecheck:
geometry.py:6:4: E111 indentation is not a multiple of four
geometry.py:7:4: E111 indentation is not a multiple of four
geometry.py:8:4: E111 indentation is not a multiple of four
geometry.py:9:4: E111 indentation is not a multiple of four
geometry.py:10:4: E111 indentation is not a multiple of four
geometry.py:13:4: E111 indentation is not a multiple of four
geometry.py:14:4: E111 indentation is not a multiple of four
geometry.py:15:4: E111 indentation is not a multiple of four
geometry.py:16:4: E111 indentation is not a multiple of four
geometry.py:18:4: E111 indentation is not a multiple of four
geometry.py:19:4: E111 indentation is not a multiple of four
geometry.py:20:4: E111 indentation is not a multiple of four
geometry.py:21:4: E111 indentation is not a multiple of four
geometry.py:22:4: E111 indentation is not a multiple of four
geometry.py:24:4: E111 indentation is not a multiple of four
15 E111 indentation is not a multiple of four

PEP257 stylecheck:
Code conforms to PEP257 (docstring conventions) guidelines! Great work!

Style percentage: 0%

Test: test_ex01_geometry.py

test_geometry_triangle_example_output[subprocess]: FAILED (21.74 ms)

test_geometry_circle_example_output[subprocess]: FAILED (51.09 ms)

test_geometry_square_random_output[subprocess]: FAILED (27.18 ms)

test_geometry_triangle_random_output[subprocess]: FAILED (21.5 ms)

test_geometry_else_output[subprocess]: passed (41.63 ms)

Total number of tests: 9
Passed tests: 2
Failed tests: 7

What I have tried:

I have changed the name of variables, wrote big and small letters, but still incorrect.
Posted
Updated 8-Sep-19 10:50am

## Solution 1

Quote:
Code is ready and working, but GIT shows incorrect

as far as I can see, your usage of 3 spaces as indentation is perfectly legal, but Git want 4 spaces.
"indentation is not a multiple of four"

Top Experts
Last 24hrsThis month
 OriginalGriff 80 Wendelius 60 Richard Deeming 25 Pete O'Hanlon 25 Aggeliki Asimakopoulou 10
 OriginalGriff 511 Pete O'Hanlon 250 Richard Deeming 200 Dave Kreskowiak 133 CPallini 110

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900