溫馨提示×

python怎么用函數計算圓周長

九三
2407
2021-02-07 17:35:35
欄目: 編程語言

python怎么用函數計算圓周長

python中使用math模塊中的常量pi計算圓周長,具體方法如下:

1.首先,在python中導入math模塊;

import math

2.math模塊導入后,執行以下命令即可對圓的周長進行計算;

import math

radius1 = input("radius of cricle:")

radius2 = float(radius1)

circumference=2*math.pi*radius2

print("circumference of circle:",circumference)

0
亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女