- 要求:
2. 代码(第一天晚上1小时,第二天晚上3小时,细节太多了,不断调试修改,终于成功!)
bodies = {}
while True:
menus = ("1,录入","2,查询","3,删除","4,修改","5,退出")
for i in menus:
print('按'+ i)
body_id = 1
a = input("请输入菜单项:")
if a.isdigit() == False:
print('别捣乱了!')
continue
a = int(a)
if a != 1 and a !=2 and a!=3 and a!= 4 and a != 5:
print('请输入正确的菜单项!')
continue
if a == 1:
count = 1
while True:
name_1 = input('请输入TA的名字:')
height_1 = input('请输入TA的身高(单位为m):')
weight_1 = input('请输入TA的体重(单位为kg):')
if 'm' or '米' in height_1:
height_1 = height_1.replace('米','')
height_1 = height_1.replace('m','')
height_1 = height_1.strip()
if 'kg' or '千克' in weight_1:
weight_1 = weight_1.replace('千克','')
weight_1 = weight_1.replace('kg', '')
weight_1 = weight_1.strip()
bmi_1 &