📜  在python代码示例中找到圆的面积

📅  最后修改于: 2022-03-11 14:45:33.074000             🧑  作者: Mango

代码示例1
import math

radius = 3
area = math.pi * radius * radius
# another way would be to set variable and round - rounded_area = round(area, 3)
print(f'The area of the circle is {area:.3f}')
# round answer to 3 decimal places