【发布时间】:2012-11-07 01:42:58
【问题描述】:
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'))
我一直在 else 和 : 之间的最后一行收到语法错误,当我在上面的第 3 行完全相同时,我不知道为什么它是错误的。非常感谢任何帮助。
【问题讨论】:
-
你真的应该发布确切的错误信息。
-
这只是括号,谢谢大家。
标签: python syntax if-statement