# BMI计算器
height = float(input("请输入身高(m):"))
weight = float(input("请输入体重(kg):"))

bmi = weight / (height ** 2)
print(f"你的BMI值是:{bmi:.2f}")

if bmi < 18.5:
    print("偏瘦")
elif 18.5 <= bmi < 24:
    print("正常")
elif 24 <= bmi < 28:
    print("超重")
else:
    print("肥胖")

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: