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:語法錯誤?
你應該真的發佈確切的錯誤信息。 – Miguel
它只是支架,謝謝你們。 – user1804787