答案揭晓:
height = float(input("请输入您的身高:~"))
写法一:这个写法只适用于python
if 1 <= height <=1.5:
print("小强 你在哪里?")
elif 1.5 < height <= 1.7:
print("没有安全感~")
elif 1.7 < height <= 1.8:
print("帅哥 留个电话")
elif 1.8 < height <=2:
print("帅哥 你建议多一个女朋友吗")
else:
print("身高刚到你的腰,我们并不合适")
写法二:通用写法
if height >= 1 and height <= 1.5:
print("小强 你在哪里?")
elif height > 1.5 and height <= 1.7:
print("没有安全感~")
elif height > 1.7 and height <= 1.8:
print("帅哥 留个电话")
elif height > 1.8 and height <= 2:
print("帅哥 你建议多一个女朋友吗")
else:
print("身高刚到你的腰,我们并不合适")