M
M
My account2018-06-15 23:04:17
Python
My account, 2018-06-15 23:04:17

Syntax error, python, how to fix?

Swears at the code

a = int(input())
b = int(input())
c = int(input())
if a > b and b > c:
    print(a)
    print(c)
    print(b)
elif c > b and a > c:
    print (a)
    print (b)
    print (c)
elif b > a and a > c:
    print(b)
    print(c)
    print(a)
elif c > a and b > c:
    print(b)
    print(a)
    print(c)
elif c > b and b > a:
    print(c)
    print(a)
    print(b)
    else a > b and c > a:
        print(c)
        print(b)
        print(a)

In the line with else
Indents are all correct

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fixid, 2018-06-15
@oksanaa352

If it's correct, then paste it here as well.
And don't forget the text of the error.
Well, look at the else syntax , more precisely, that there should not be conditions there. It 's ELSE ! Just think logically.
And as a last resort, look very closely at the canonical construction:

if test1:
    state1
elif test2:
    state2
else:
    state3

G
gr0w1x, 2018-06-16
@gr0w1x

The else should not contain conditions, the space before the else is also superfluous.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question