Review: Built in Functions: stuck


#1

Hi
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?


#2

Did you try after refreshing your browser.

also check the function name too


#3

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


#4

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