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
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?
Hello,
it would be nice if someone could tell me what I’m doing wrong here. As far as I understand the task correctly I should only create the function.I want to test it (“run”). If I am asked to test it with an unrealistic return. Is it my mistake or that of the script?
The code above only returns the equality case, and not the value that is greater than the other. Add that code to your function after the if statement.
I may be misudnerstanding you but these lessons are just an introduction to the basics of controlloing flow in Python. It’s to teach the syntax and general stucture of conditionals, they’re not meant to be applicable to every possible scenario. More generally you’d wind up with a lot of unnecessary else: pass statements if you had to deal with the False output too.
Working through the Relational Operators II (page 6) instructions:
The first step doesn’t provide values for x and y so I’ve written it as is, and I’ve been consistently getting an error that it is expecting 2 actual values defined for x and y. How am I supposed to know what to use if the instructions don’t say?