19/19 - Keep on getting Error


#1

I'm expecting my code to work, however, there seems to be sure that I get "Oops, try again. Your function seems to fail on input -10 when it returned '-10' instead of '10' ." I tried calling it manually and I get -10. What seems to be the issue here?

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

#2

Make sure you're using print and return where it says to. It's usually picky about those. It looks correct aside from that.


Yea I just looked at the exercise. Get rid of the return statement you currently have and change the prints to returns and it should work.


#3

Thank you for your help!