fork download
  1. # your code goes here
  2. height=1.75
  3. weight=75
  4. username='小明'
  5. bmi=weight/height**2
  6. print(f'{username}您好,您的体质指数为{round(bmi,1)}')
  7. if bmi>=18.5:
  8. print(f'{username}您好,您的指数偏瘦')
  9. elif bmi>=24.9:
  10. print(f'{username}您好,您的指数正常')
  11. elif bmi>=29.9:
  12. print(f'{username}您好,您的指数超重')
  13. else:
  14. print(f'{username}您好,您的指数肥胖')
Success #stdin #stdout 0.07s 14136KB
stdin
Standard input is empty
stdout
小明您好,您的体质指数为24.5
小明您好,您的指数偏瘦