Discuss / Python / 作业,亲测测试无误~~

作业,亲测测试无误~~

Topic source

樟紫草

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

!/usr/bin/env python3

-- coding: utf-8 --

print('本计算公式适用于18-40周岁人群') h=input('请输入身高(m):') w=input('请输入体重(Kg):') b=float(w)/float(h)**2 if b<18.5: print('过轻') elif b>=18.5 and b<25: print('正常') elif b>=25 and b<28: print('过重') elif b>=28 and b<32: print('肥胖') elif b>=32: print('严重肥胖')

RiverSunStar

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

你好 为什么我完全复制你的代码进去 然而还是显示B is not defined呢?


  • 1

Reply