程序如下:
import math
side = eval(input(“Please input the hexagon side:”))
Area = (3 * math.sqrt(3) / 2) * side ** 2
print(“The area of the hexagon is %.4f”%Area)
程序运行结果:
程序如下:
import math
side = eval(input(“Please input the hexagon side:”))
Area = (3 * math.sqrt(3) / 2) * side ** 2
print(“The area of the hexagon is %.4f”%Area)
程序运行结果: