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.

1
  • @dataj mark the answer as accepted if it works Feb 1, 2021 at 6:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.