Review: Built-In Functions


#1

HELP NEEDED PLEASE

def distance_from_zero(j):
if type(j)== int or type(j)== float:
return abs(j)
else:
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


#2

It works fine.

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


#3

Thank you
My indentation for else: was not correct


#4

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