Discuss / Python / zuoye

zuoye

Topic source

宿酱

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

#!/usr/bin/env python3

weight=float(input('please input the weight\n')) height=float(input('please input the height\n')) print(pow(height,2)) if BMI<18.5: print('starve right?') elif BMI<=25: print('normal') elif BMI<=28: print('fattttttT') elif BMI<=32: print("too fattttttt") else: print('even god cannot save you..')

王豪bupt

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

def BMI(a,b,name): a=float(a) b=float(b) s=b*b/a s=float(s) if s<18.5: print("%s过轻" %(name)) elif 18.5<=s<25: print("%s正常" %(name)) elif 25<=s<28: print("%s过重" %(name)) elif 28<=s<32: print("%s肥胖" %(name)) else: print("%s过重" %(name)) BMI(1.75,60.5,'小明')


  • 1

Reply