题目
这是用Python编写的“BMI值计算程序”,根据截图完成填空。
height=input('你的身高是多少米:')
height=float(height)
weight =input('你的体重是多少KG:')
weight =float(weight)
BMI=weight/(height*height)
if BMI>=24.9:
print('肥胖')
① BMI<24.9 ②
BMI>=18.5:
print('正常')
else:
print('偏瘦')
(1)
从图中可知,程序中使用的是语句,在语句后输入“”,下面的程序会强制缩进。
(2)
程序中定义height和weight为。
(3)
请补充完整程序:①;②。
(4)
图中函数是Python的内置函数,主要用于数据的输入。
答案: 【1】if(或条件)【2】:(冒号)
【1】变量
【1】elif【2】and
【1】input( )