郭怡吟python, input, str, float

VS code程式碼

from math import * def abc(r): print("郭怡吟輸入的半徑 " + str(r)) print("圓面積: "+str(pi*r*r)) print("圓周長: "+str(pi*r*2)) print("球體積: "+str(pi*r*r*r*4/3)) print("球表面積:"+str(pi*r*r*4)) def tri(z): print("郭怡吟輸入的度 " + str(y)) print("正弦sin "+str(sin(z))) print("餘弦cos "+str(cos(z))) def group(r, t): abc(r) tri(t) r = float(input("輸入半徑: ")) y = float(input("輸入角度360度單位: ")) t = y/180*pi group(r,t)

VS code編輯環境截圖

說明影片

留言

這個網誌中的熱門文章

郭怡吟python陣列array

郭怡吟w3schools學Java,整數int,字串String,迴圈for loop.Character. totring將字碼轉成字元

郭怡吟w3schools字串str, format, slicing[::]