jeudi 2 novembre 2017

Simple python if/else syntax not working

I am trying to create a simple test-scorer that grades your test and gives you a response - but a simple if/else function isn't running -

Python -

testScore = input("Please enter your test score")


if testScore <= 50:
  print "You didn't pass... sorry!" 
elif testScore >=60 and <=71:
  print "You passed, but you can do better!"

The Error is -

Traceback (most recent call last):
  File "python", line 6
    elif testScore >= 60 and <= 71:
                              ^
SyntaxError: invalid syntax

Aucun commentaire:

Enregistrer un commentaire