Function Not functional


#1



can someone help me please with this code,
it looks like its all good, but this message is keep coming up.

what is wrong with my code here?



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


this is my code:

def distanc_from_zero(one):
    
    if type(one) == int or type(one) == float:
        return abs(one)  
    else:
        return "nope"

thanks alot


#2

I believe you meant distance_from not distanc_from


#3

ohh your right!

Thanks :slight_smile:


#4

No problem! :smiley: Happy coding!


#5

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