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