Python:语法错误? A=int(输入('输入三个数字中的第一个:')) B=int(输入('输入三个数字中的第二个:')) C=int(输入('输入三个数字中的第三个:')) 列表=[A、B、C] SL=已排序(列表) 如果SL[0]

Python:语法错误? A=int(输入('输入三个数字中的第一个:')) B=int(输入('输入三个数字中的第二个:')) C=int(输入('输入三个数字中的第三个:')) 列表=[A、B、C] SL=已排序(列表) 如果SL[0],python,syntax,if-statement,Python,Syntax,If Statement,从第二行到最后一行缺少结束括号,则应为: A=int(input('Enter the first of three numbers: ')) B=int(input('Enter the second of three numbers: ')) C=int(input('Enter the third of three numbers: ')) list=[A,B,C] SL=sorted(list) if SL[0]<0: if SL[1]-1==SL[0]:

从第二行到最后一行缺少结束括号,则应为:

A=int(input('Enter the first of three numbers: '))
B=int(input('Enter the second of three numbers: '))
C=int(input('Enter the third of three numbers: '))
list=[A,B,C]
SL=sorted(list)
if SL[0]<0:
    if SL[1]-1==SL[0]:
        print (list('they are good'))
    else: print (list('not good'))
elif SL[2]-1==SL[1]:
    print (list('they are good')
else: print (list('not good'))

您在倒数第二行缺少一个结束括号,它应该是:

A=int(input('Enter the first of three numbers: '))
B=int(input('Enter the second of three numbers: '))
C=int(input('Enter the third of three numbers: '))
list=[A,B,C]
SL=sorted(list)
if SL[0]<0:
    if SL[1]-1==SL[0]:
        print (list('they are good'))
    else: print (list('not good'))
elif SL[2]-1==SL[1]:
    print (list('they are good')
else: print (list('not good'))
第二行到最后一行缺少尾随“)”。第二行到最后一行缺少尾随“)”

    print (list('they are good'))
print语句末尾缺少结束符


缺少打印语句结尾处的结束语。

您应该发布准确的错误消息。这只是括号,谢谢各位。您应该发布准确的错误消息。这只是括号,谢谢各位。