My function isnt being defined


#1



I have defined a function called distance_from_zero. For some reason in the area where you input the code, its not appearing as if it is defined.


def distance_from_zero(distance):
if type(distance) == int or type(distance) == float:
    return abs(distance)
else:
    return "Nope"


#2

The code block needs to be indented.


#3

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