19 - Mysterious mistake?


#1



https://www.codecademy.com/courses/python-beginner-c7VZg/4/3?curriculum_id=4f89dab3d788890003000096#

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


def zero_distance(x):
    type(x)
    if type(x) == int or type(x) == float:
        return abs(x)
    
    else:
        return "nope"
zero_distance(5)

Where is the mistake ? Please help. Thx


#2

You dont need this line

And your function chould be called distance_from_zero instead of zero_distance