What's wrong


#1



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)
    else:
        return "Nope"


#2

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


#3

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