def area(n, side):
n = eval(input("Enter the number of sides: ")) # 多边形的边数
side = eval(input("Enter the side: ")) # 多边形的长度
area_num = (n * pow(side, 2)) / (4 * math.tan(math.pi / n))
print("The area of the pentagon is {:>.20f}".format(area_num))
area(1, 2)
代码收