2.15 <全国计算机等级考试二级教程python
print("""
2022-11-27
021501version
""")
class AreaOfHex:
def __init__(self, half_num, factor):
self.half = half_num
self.factor = factor
def convert(self, value):
a = 3 * pow(self.factor, 0.5) / self.half
return a * pow(value, 2)
def main():
value = eval(input("Enter the side: "))
c1 = AreaOfHex(2, 3)
print("The area of the hexagon is", format(c1.convert(value), '.4f'))
main()