Please, find the syntax error fixes below:
print ("Type in your IGCSE mark")
MARK=int(input(''))
if MARK >= 89 and MARK <= 100:
print ("PARTY HARD! You have gotten A*")
elif MARK >= 79 and MARK <=90:
print ("AMAZING! You have gotten an A")
elif MARK >= 69 and MARK <=80:
print ("Not bad! You have gotten a B")
elif MARK >= 59 and MARK <=70:
print ("Could be better. You have gotten a C")
elif MARK >= 49 and MARK <=60:
print ("Try harder! You have gotten a D")
elif MARK >= 39 and MARK <=50:
print ("Pay more attention in class. You have gotten an E")
elif MARK >= 90 and MARK <=100:
print ("I suggest you go to a tuition. You have gotten an F")
else:
while (MARK >= 100 or MARK <= 0):
print ("Invalid Input")
And here are the compilation errors:
- missing colon from the end of line
- missing MARK from the left side of the <= operator; also missing colon from the end of line
- line needs to be indented
After this, your code compiles, but it has many issues.
- There are overlapping regions (e.g. first if [89, 100] and last if [90, 100]) overlap. This is a logic error, although the code runs OK. -- there are many overlaps, not just this)
- The last condition (despite the high scores suggests a failure) -- another logic error
- the while in the last lines will print "Invalid Input" 'till eternity. You should have your whole input and mark checking logic inside the body of your loop. But they you should tell the user what input allows them to leave the loop. Or just don't make any loop at all. ;)
Everything fixed would produce a code like this:
mark = int(input("Type in your IGCSE mark: "))
if mark > 100 or mark < 0:
print ("Invalid Input")
elif mark >= 90:
print ("PARTY HARD! You have gotten A*.")
elif mark >= 80:
print ("AMAZING! You have gotten an A.")
elif mark >= 70:
print ("Not bad! You have gotten a B.")
elif mark >= 60:
print ("Could be better. You have gotten a C.")
elif mark >= 50:
print ("Try harder! You have gotten a D.")
elif mark >= 40:
print ("Pay more attention in class. You have gotten an E.")
else:
print ("I suggest you go to a tuition. You have gotten an F.")