19/19 Seems right but says "returned '1' instead of "nope"

def function_from_zero(sam):
  if type(sam) == int or type(sam) == float:
    return abs(sam)
    return 'Nope'


why should it return nope? There never is a function call, so the function never executes. The exercise might call the function for validation purpose.


Not sure, that’s what the error was. I gave up and selected ‘Get Code’ and it gave me the exact code i wrote except the argument was ‘num’ instead of ‘sam’


that is very unlikely, do still have the faulty code?

Ah, that was the error message, i see.


I think the exercise calls the function “distance_from_zero” whereas your function is “function_from_zero”? Just a guess.


The function name needs to be a match, so that would explain it. Nice catch :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.