Returning an error


def distance_from_zero(n):
if type(n) == int or type(n) == float:
return abs(n)
return "nope"

error comes up saying
Your function seems to fail on input -10 when it returned 'Nope' instead of '10'

Anyone know why?


Helps if people can test your code. Make sure it's intact.

If there's an error message in the console that means your code crashed, tend to that first.