Discuss / Python / 交作业

交作业

Topic source

Nana-198806

#1 Created at ... [Delete] [Delete and Lock User]

shenggao=float(input("请输入您的身高(单位m):"))

tizhong=float(input("请输入您的体重(单位Kg):"))

BIM=float("%.2f" %(tizhong/shenggao**2))

print("BIM=%s" %BIM)

if BIM<18.5:

    print("过轻")

elif BIM<25:

    print("正常")

elif BIM<28:

    print("过肥")

elif BIM<32:

    print("肥胖")

else:

    print("严重肥胖")

Billy_周_

#2 Created at ... [Delete] [Delete and Lock User]

你好,那个值不是BIM,应该是BMI。哈哈,也不是多大事。


  • 1

Reply