What's wrong


Oops, try again. Your function seems to fail on input True when it returned '1' instead of 'Nope'

it should work

Replace this line with your code. 
def distance_from_zero(x):
    if x == float(x) or int(x):
        return abs(x)
        return "Nope"


look at the example:

def is_numeric(num):
    return type(num) == int or type(num) == float:

see how comparisons are done at both side of the or operator? If you don't do this, python is going to evaluate if int(x) is True


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