陳俊宇python, input, str, float
VS code編輯環境截圖
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)
留言
張貼留言