1 . 進入 repl.it 線上 ptyhon 網站,可用Google帳號登入
1 . 進入 repl.it 線上 ptyhon 網站,可用Google帳號登入
print("Hello ! 歡迎計算您的身體質量指數BMI !")
m=eval(input("請輸入您的體重(單位: 公斤): "))
h=eval(input("請輸入您的身高(單位: 公尺): "))
BMI=m/pow(h,2)
print("您的BMI 為 :",round(BMI,0))
if BMI>=35:
print("你的體重為: 重度肥胖!")
if BMI>=30 and BMI<35:
print("你的體重為: 中度肥胖!")
if BMI>=27 and BMI<30:
print("你的體重為: 輕度肥胖!")
if BMI>=24 and BMI<27:
print("你的體重為: 過重!")
if BMI>=18.5 and BMI<24:
print("你的體重為: 正常範圍!")
if BMI<18.5:
print("你的體重為: 過輕!")