From 3c9a64675b22f74d23b04d0eb5b933eef9925eba Mon Sep 17 00:00:00 2001 From: 643e1391b783586d70dbdc7a <643e1391b783586d70dbdc7a@devide> Date: Tue, 18 Apr 2023 04:36:52 +0000 Subject: [PATCH] Auto commit --- main.py | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 4c0c135..d1eed1a 100644 --- a/main.py +++ b/main.py @@ -1 +1,32 @@ -print('欢迎来到 InsCode') \ No newline at end of file +height = eval(input('请输入你的身高')) +if height > 3: + height = 0 + height = eval(input('请注意身高的单位是米!请重新输入身高!')) + weight = eval(input('请输入您的体重')) + BMI = weight / (height * height) + if BMI > 28: + print('您的BMI指数为', BMI) + print('您属于肥胖型身材!管住嘴迈开腿才会更健康哦!') + elif BMI > 24: + print('您的BMI指数为', BMI) + print('您的体重过重了!要注意控制体重哦!') + elif BMI > 18.5: + print('您的BMI指数为', BMI) + print('您属于标准身材!继续保持哦!') + else: + print('您的BMI指数为', BMI) + print('您太瘦啦!健康美才最美!') +weight =eval(input('请输入您的体重')) +BMI = weight / (height * height) +if BMI > 28: + print('您的BMI指数为', BMI) + print('您属于肥胖型身材!管住嘴迈开腿才会更健康哦!') +elif BMI > 24: + print('您的BMI指数为', BMI) + print('您的体重过重了!要注意控制体重哦!') +elif BMI > 18.5: + print('您的BMI指数为', BMI) + print('您属于标准身材!继续保持哦!') +else: + print('您的BMI指数为', BMI) + print('您太瘦啦!健康美才最美!') \ No newline at end of file -- GitLab