fork download
  1. # 定义身高变量
  2. height = 1.75
  3. # 定义体重变量
  4. weight = 75
  5. # 定义用户名变量
  6. username = '小明'
  7. # 求体质指数
  8. bmi = weight / height**2
  9. # 打印体质指数
  10. print(f'username您好,您的体质指数为{round(bmi,1)}')
  11.  
Success #stdin #stdout 0.07s 14012KB
stdin
Standard input is empty
stdout
username您好,您的体质指数为24.5