Hello everyone!
I keep running my code and it works, yet codecademy is saying it is incorrect. I don’t really understand what is going on. I don’t want to be for bad habits when writing code so that I why I am asking the community for a little clearification. My code is as follows- ef graduation_reqs(gpa, credits):
if (gpa >= 2.0) and (credits >= 120):
return “You meet the requirements to graduate!”
elif (gpa >= 2.0) and not (credits >= 120):
return “You do not have enough credits to graduate.”
elif (credits >= 120) and not (gpa <= 2.0):
return “Your GPA is not high enough to graduate.”
elif (credits <= 120) and not (gpa >= 2.0):
return “Your GPA is not high enough to graduate.”
else:
(credits != 120) and (gpa != 2.0)
return “You do not meet either requirement to graduate!”
print(graduation_reqs(0.0,0))
It works in the python shell when I run it, but I want to know what I am doing wrong and why my question is wrong.