dimanche 31 janvier 2021

Getting error with if else statement in python using input

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

Aucun commentaire:

Enregistrer un commentaire