Hey guys! Was wondering if anyone could give me a hand with this one, I've been stuck here for a while:
Here is my code:
def distance_from_zero(n): if type(n) == int or type(n) == float: return abs(n) else: return "Nope"
I'm getting this error message and I'm not sure how to fix it:
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
This is the error that's coming up in the console:
File "python", line 2
if type(n) == int or type(n) == float:
IndentationError: expected an indented block
Any help would be MUCH appreciated, thank you.