roberthsu2003 / __2024_05_05_sunday__

AI 人工智慧開發入門_python
30 stars 3 forks source link

##參考同學計算圓面積程式練習 #9

Closed Rola0605 closed 5 months ago

Rola0605 commented 5 months ago

參考同學計算圓面積程式練習

pi = 3.14
r = 2
area =(pi*r*r)
print ( " 圓面積:",area)

_Originally posted by @Rola0605 in https://github.com/roberthsu2003/__2024_05_05_sunday__/issues/8#issuecomment-2094700933_

thunder114069 commented 5 months ago

from cmath import pi R=10 area=(pi*(R**2)/2) print("圓面積為",area)

@thunder114069 ➜ /workspaces/2024-05-05-1- (main) $ /usr/local/bin/python /workspaces/2024-05-05-1-/thunder/5-5.py 圓面積為 157.07963267948966