Built In Functions Error- "Fail on Input -10)



I am receiving the error:
"You function seems to fail on input -10 when it returned 'None' instead of '10'

I'm not sure why my code will not work...for the life of me cannot figure out what I am doing wrong.

Replace this line with your code. 

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


Did you try to return instead of print?


Just did that. Thank you!


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