FAQ: Control Flow - Relational Operators II

This community-built FAQ covers the “Relational Operators II” exercise from the lesson “Control Flow”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Computer Science
Data Science

FAQs on the exercise Relational Operators II

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

10 posts were split to a new topic: Why doesn’t my code work without a print?

3 posts were split to a new topic: Why doesn’t my function work?

5 posts were split to a new topic: Do I need to be utilizing return or print?

5 posts were split to a new topic: Is there something wrong with my indentation?

when I wrote the function
def graduation_reqs(credits):
if credits > 120:
return “You have enough credits to graduate!”
It showed me error that it wanted graduate_reqs(120) as the function.
But when I checked the solution it showed me the same function as I wrote and did gave any error. There’s definitely some problem in the webpages’ program. Please solve. @discobot

1 Like

Hi! To find out what I can do, say @discobot display help.

Dude this excercise was unbelievable, i wrote the code perfectly as asked, when i run the code it’s says it’s not correct. After i press the “show solution” button, it shows me the exact same code. Ok fine, number 3 i have to write the print statement even that it showed as wrong while in the solution it was exactly the same code, dude wtf?

1 Like

I see this issue has already been mentioned before. Still not fixed.

Hey @textjumper17671, welcome to the forums!

Can we see your original code? You never know, maybe something was spelled wrong or you had some extra white space.

Hi stevencopeland, thank you!

Sure thing, absolutely no problem.
So i just redid the excercise this is are the first 2 steps i wrote:

def greater_than(x, y):
if x > y:
return x
if y > x:
return y
if x == y:
return “These numbers are the same”

def graduation_reqs(credits):
if credits >= 120:
return “You have enough credits to graduate!”

The first step seemed to go fine, the second step gives me the error ''did you remember to define graduation_reqs"?

The third went flawless.

Update: I think it’s because of the spaces before the code? That seems to be the only logical issue to me.

Do you think you could format your code so we could see all the whitespace? Try putting three backticks(`) before and after your code?

Check out this post if you need help: