Why doesn't this code pass?

Can someone tell me why this is returning as " Expected graduation_reqs() with gpa = 0.0 and credits = 0 to return “You do not meet either requirement to graduate!”?

statement_one = False

statement_two = True

def graduation_reqs(gpa, credits):
if (gpa >= 2.0) and (credits >= 120):
return “You meet the requirements to graduate!”
if not credits >= 120:
return “You do not have enough credits to graduate.”
if not gpa >=2.0 :
return “Your GPA is not high enough to graduate”
if (gpa < 2.0) and (credits < 120):
return “You do not meet either requirement to graduate!”

1 Like

Study your logic. It is testing for one condition and returning. Failing that it is testing the other condition and returning. Failing that it cannot possibly pass the last condition. Bring that conditional to above the other two.

a < m and b < n

then

a < m

b < n

This does not make sense to me.
a has nothing to do with b or n
and
m has nothing to do with b or n
and
b has nothing to do with a or m
and
n has nothing to do with a or m

My current code is not working:

def graduation_reqs(gpa, credits):
if (gpa >= 2.0) and (credits >= 120):
return “You meet the requirements to graduate!”
if not (credits>=120):
return “You do not have enough credits to graduate.”
if not (gpa >= 2.0):
return “Your GPA is not high enough to graduate.”
if not (gpa >= 2.0) != (credits >= 120):
return “You do not meet either requirement to graduate!”

It states, " Expected graduation_reqs() with gpa = 0.0 and credits = 0 to return “You do not meet either requirement to graduate!” "

Since you have covered the main conditions already, this statement is moot. No if required since the final return is the default.

if ...:
    return ...
if ...:
    return ...
if ...:
    return ...
return 'default'

Be sure to check the instructions so your returns match the expectation of the lesson checker.