I’ve been tasked with the following:
Let’s return to Calvin Coolidge’s Cool College . 120 credits aren’t the only graduation requirement, you also need to have a GPA of 2.0 or higher. Rewrite the
graduation_reqsfunction so it takes two inputs,
credits, and checks to see if a student meets both requirements using an
andstatement. If they do, return the string “You meet the requirements to graduate!”
Here is my code:
def graduation_reqs(credits, gpa): if credits >= 120: return "You have enough credits to graduate!" if credits >= 120 and gpa >= 2.0: return "You meet the requirements to graduate!"
I’m really not sure if I can include the AND statement in the first condition because it is asking me to do a second return statement. Maybe I’m misunderstanding the question.