{%hackmd @dzif24x25/IBXIWNXgTju0h2AKtSaLkA %} ###### tags: `Python練習題 - 參考程式` # 0303練習題 - BMI計算機 - 參考程式 ```python= print('BMI計算機') print() height = float(input('請輸入您的身高(公分):')) weight = float(input('請輸入您的體重(公斤):')) bmi = weight / (height / 100) ** 2 print() if bmi < 18.5: print(f'您的BMI為{bmi:.2f},為過輕體位') elif bmi < 24: print(f'您的BMI為{bmi:.2f},為正常體位') elif bmi < 27: print(f'您的BMI為{bmi:.2f},為過重體位') else: print(f'您的BMI為{bmi:.2f},為肥胖體位') ``` 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up