Review: Built-In Functions



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

Oops, try again. It looks like you have a NameError. Maybe you forgot to create a function called distance_from_zero? Check the error message for more info! - global name 'distance_from_zero' is not defined


It works fine.

Refresh your page.
Also check if everything spelled correctly. (I have checked no spelling error)
Check if indentations are done properly.


Thank you
My indentation for else: was not correct


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