+ 1

# Polygon area

formula of polygon area if all side of polygon is equal: (n * s ^ 2) / 4 * tan(π / n) where n is number of side of polygon and s is side's length can someone correct my code please import math sides = int(input("number of side >> ")) sides_l = int(input("side length >> ")) a = math.pi / sides p_area = sides * sides_l ** 2 / 4 * math.tan(a) print(f"number of side: {sides} side length: {sides_l} area of polygon: {round(p_area, 3)}") first input: 6 second input: 5 #expect output 64.952 #my output 21.637 why my answer is not match with expect answer ?

2 Answers