关于作者

Discuss / Python / 交作业

交作业

Topic source

Z-Maker乐悠悠

#1 Created at ...

height = float(input('请输入身高(m):')) #float将输入字符串转换为数值型 print('身高:',height) weight = int(input('请输入体重(kg):')) #float转换为浮点数,int转换为整形 print('体重:',weight) bmi = weight/(height*height); print('BMI = ',bmi) if bmi < 18.5: print('过轻'); elif 18.5<=bmi<=25: print('正常'); elif 25<=bmi<=28: print('过重'); elif 28<=bmi<=32: print('肥胖'); else: print('严重肥胖');


  • 1

Reply

WARNING: You are using an old browser that does not support HTML5. Please choose a modern browser (Chrome / Microsoft Edge / Firefox / Sarafi) to get a good experience.