I have a problem with a error message after running the following code :
def greather_than(x, y):
return "These numbers are the same"
the error message is Did you remember to define
greater_than ? My impression is that a function is defined by the commande def function_name(input1,input2):
Please explain where i am wrong.
the function name needs to be correct, check it for spelling/typos.
this put me off for a long time I did not know what went wrong.
at the end i use give me the answer and got it.
my question can some one tell me how I can read past the error message that puts me off.
Or how I need to interpret such messages.
def greater_than(x, y):
if x > y:
if y > x:
if x == y:
Expected `greater_than` with test inputs -7 and -7 to return “These numbers are the same”
Adding the actually function call:
print greater_than(-7, -7)
to see what is actually returned helps
analyzing the error message also helps. Break it down in small pieces and make sure you understand every piece
for the rest, lots of practice and gaining experience helps Sometimes you just need to push trough
That message originated from Codecademy’s submission correctness test (SCT) for this exercise, rather than as a complaint from the Python interpreter, so it is not a standard error message. Note that the instructions include this:
y are equal, return the string
"These numbers are the same"
Evidently, the SCT test made this function call, which did not generate the expected
tank you for the info this helps a lot