Hey, just wondering if someone can explain why I am not getting any output in this code.
The first exercise is:
Write a function called
greater_than that takes two integer inputs,
y and returns the value that is greater. If
y are equal, return the string “These numbers are the same”
The code I created, and which also ticked the box was as follows:
def greater_than(x, y): if x < y: return y if x == y: return "These numbers are the same" greater_than(-8, -8)
However, it didn’t give me any feedback.
The second exercise is:
The nearby college, Calvin Coolidge’s Cool College (or 4C, as the locals call it) requires students to earn 120 credits to graduate. Write a function called
graduation_reqs that takes an input
credits and checks if the student has enough credits to graduate. If they do, return the string “You have enough credits to graduate!”
The code I created was as follows:
def graduation_reqs (credits): if credits >= 120: return "You have enough credits to graduate!" else: return "go home" graduation_reqs (100)
But again, no output.
If anyone could explain why there is no output that would be so helpful!!
Thanks in advance.