0

When I run the code below I get a a syntax error. What's the issue and how can I rectify it? Thanks!

m = input("enter number between -5 and +5: ")
m = int(m)
if m < 0:
  print( m, " is less than 0")
  elif m > 0:
    print(m, " is greater than 0")
  else:
    print(m, " is equal to 0")

1 Answer 1

5

Your indentation on the 5th line is wrong. The if, elif, and else need to be at the same indentation level.

Sign up to request clarification or add additional context in comments.

1 Comment

@dataj mark the answer as accepted if it works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.