weight = input('请输入你的体重(kg):')
height = input('请输入你的身高(m):')
weight = float(weight)
height = float(height)
BMI = weight/pow(height, 2)
print('BMI值为{:.2f}'.format(BMI))
x, y = '', '' # x为国际标准,y为国内标准
if BMI < 18.5:
x, y = '偏瘦', '偏瘦'
elif 18.5 <= BMI < 24:
x, y = '正常', '正常'
elif 24 <= BMI < 25:
x, y = '正常', '偏胖'
elif 25 <= BMI < 28:
x, y = '偏胖', '偏胖'
elif 28 <= BMI < 30:
x, y = '偏胖', '肥胖'
else:
x, y = '肥胖', '肥胖'
print('BMI指标为:国际{},国内{}'. format(x, y))
注意缩进,把最后一行print()前的空格都删掉