I am trying to make a program that displays whether or not someone meets the criteria for admission. However, I keep getting a syntax error on my first "if" statement. The code is below.
import sys
gpa=0
tscore=0
gpa=eval(input("Enter a grade point average between 0.0 and 4.0 inclusive")
if(gpa>4.0 or gpa<0.0):
print("Error: GPA must be between 0.0 and 4.0 inclusive")
sys.exit
tscore=eval(input("Enter an admission test score between 0.0 and 4.0 inclusive.")
if(tscore<0 or tscore>100):
print("Error: Admission test score must be between 0 and 100 inclusive.")
sys.exit
if(gpa>=3.0 and tscore>=60):
print("The admission result is accepted.")
if(gpa<3.0 and tscore>=80):
print("The admission result is accepted.")
else:
print("The admission result is Rejected.")`
Aucun commentaire:
Enregistrer un commentaire