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