Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python3.3:下面代码的第7行出现无效语法错误_Python - Fatal编程技术网

Python3.3:下面代码的第7行出现无效语法错误

Python3.3:下面代码的第7行出现无效语法错误,python,Python,代码如下: Weight = float(input("Enter weight in Kilograms: ")) Height = float(input("Enter height in meters: ")) BMI = (Weight / (Height**2)) print ("%.2f" %BMI) if BMI < 18.5: print ("You are under weight") elif BMI >= 18.5 and < 25.0:

代码如下:

Weight = float(input("Enter weight in Kilograms: "))
Height = float(input("Enter height in meters: "))
BMI = (Weight / (Height**2))
print ("%.2f" %BMI)
if BMI < 18.5:
    print ("You are under weight")
elif BMI >= 18.5 and < 25.0:
    print ("You weight is normal")
elif BMI >= 25.0 and < 30.0:
    print ("You are overweight")
elif BMI >= 30.0:
    print ("You are overweight")
Weight=float(输入(“以千克为单位输入重量”))
高度=浮动(输入(“以米为单位输入高度:))
体重指数=(体重/(身高**2))
打印(“%.2f”%BMI)
如果体重指数<18.5:
打印(“您体重不足”)
elif BMI>=18.5和<25.0:
打印(“您的体重正常”)
elif BMI>=25.0和<30.0:
打印(“您超重”)
elif体重指数>=30.0:
打印(“您超重”)
获取行中的无效语法 elif BMI>=18.5和<25.0:
不是重复项,但明确说明了如何正确操作。不是复制品,但明确说明了如何正确操作。
if BMI >= 18.5 and BMI < 25.0:
if BMT < 18.5:
    # underweight
elif 18.5 <= BMI < 25.0:
    # normal
elif 25.0 <= BMI < 30:
    # overweight
elif 30 <= BMI:
    # super overweight