python-3.x 语法错误:应为“:”

jhdbpxl9  于 2023-05-08  发布在  Python
关注(0)|答案(1)|浏览(140)

我该怎么办?
我给出了这个错误:

mylist=input('please inter your condition :')
If mylist == '10' or '9' or '8':
   print('well')
   print('well done')
else if mylist == '7' or'6' or '5' or '4' or '3':
   print('mid') 
   print('moderate') 
else if mylist == '2'   or '1':
   print('weak')
else print('0')  

 File "<ipython-input-42-fc470037cf12>", line 5
    else if mylist == '7' or'6' or '5' or '4' or '3':
         ^
SyntaxError: expected ':'

我更改以下间距:但是...我该怎么办?

s5a0g9ez

s5a0g9ez1#

在Python中,if...else语句有三种形式:
if语句
if...else语句
if... elif... else语句

相关问题