Review Built-in functions a little stuck


I am not really sure where I am going wrong I feel as though my code is correct but I keep getting the following error

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

If anyone can explain to me where I am going wrong, that would be really appreciated.

def distance_from_zero(n):
    if type(n) == int or type(n) == float: 
        return abs(n)


A function ends when the return keyword is reached. Do you see the issue here?


Thank you so much for replying so quickly I saw what my error was. I hadn't;t asked it to return "nope"


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