python计算圆的面积(使用python计算圆的面积和周长)

发布时间:2025-12-11 02:36:24 浏览次数:2

使用python计算圆面积和周长的方法

圆周长计算公式:girth = 2πr

圆面积计算公式:area = πr

参数:

r:表示圆的半径。

import math

radius=input("radius of cricle:")

girth=2*math.pi*radius

area=math.pi*radius*radius

print ( "circumference of circle: %.2f" % girth)

print ( "area of cricle: %.2f"% area)

python计算圆的面积
需要做网站?需要网络推广?欢迎咨询客户经理 13272073477