Help about Built in functions(19/19)


#1

Hello people, this is my code but it is not working. Can anyone help?

def distance_from_zero(j):
return distance_from_zero
if type(j) is int:
return abs(j)
if type(j) is float:
return abs(j)
else:
return "Nope."


#2

@robotic_hair

Hi,
You can't return a function inside of itself!


#3

first, please always mention the error details

the text below def line should be indented ; but more important there is no if statement before the return statement like in other lines - you first if ... something and then if condition is true you execute the return statement. so you have missed something from the instruction


#4

You can't return at the beginning of your function, every code after return in function won't be executed.