Weight=float(input('Please input your Weight='))
Height=float(input('Please input your Height='))
BIM=Weight/Height**2
if BIM<18.5:
print('过轻')
elif BIM>=18.5 and BIM<25:
print('正常')
elif BIM>=25 and BIM<28:
print('过重')
elif BIM>=28 and BIM<32:
print('肥胖')
else:
print('严重肥胖')
# 匹配模式
Weight=float(input('Please input your Weight='))
Height=float(input('Please input your Height='))
BIM=Weight/Height**2
match BIM:
case x if x<18.5:print('过轻')
case x if x>=18.5 and x<25:print('正常')
case x if x>=25 and x<28:print('过重')
case x if x>=28 and x<32:print('肥胖')
case x if x>=32:print('严重肥胖')