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'))

I keep getting a syntax error on the last line in between else and : and i have no idea why it's wrong when i have the exact same line 3 lines above. Any help much appreciated.

2
  • 2
    You should really post the exact error message. Commented Nov 7, 2012 at 1:44
  • 2
    it was just the bracket, thanks guys. Commented Nov 7, 2012 at 1:52

3 Answers 3

4

You are missing an end parenthesis on the second to last line, it should be:

    print (list('they are good'))
Sign up to request clarification or add additional context in comments.

Comments

1

You're missing a trailing ')' on the second-to-last line.

Comments

1
elif SL[2]-1==SL[1]:
    print (list('they are good')

Missing a closing ) at the end of the print-statement.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.