Review: Built in Functions: stuck


I stucked.

My code:

> def distance_form_zero(n):
>     # Return absolute value of integer and float
>     if type(n) == int or type(n) == float:
>         return abs(n)
>     else:
>         return ("Nope")

After interpretation it returns error

Oops, try again. Your function seems to fail on input True when it returned ‘1’ instead of ‘Nope’

Anyone can help me?


Did you try after refreshing your browser.

also check the function name too


Thanks! There was an error in function name… So so stupid mistake.


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