Need help here distance from zero


#1

i need help here!!!
my code:
def distance_from_zero(number):
if type(number) == int or type(number) == float:
return abs(int)
else:
return "nope"


19. Review: Built-In_Functions
#2

Hello,
Try this code by taking the problem in another way ... upside somehow, it work fine !
Caution : it's better not to copy/paste the code but write it in the editor

def distance_from_zero(param):
    typeParam = type(param)
    if not typeParam != int or not typeParam != float:
        return abs(param)
    else:
        return "Nope"
# Test
distance_from_zero(-7.5)

#3
def distance_from_zero(d): #make an function called distance_from_zero and assign to variable (d)
    if type(d) == int or type(d) == float:  #fucntion if ask for variable (d) are equal to integer or float
        return abs(d) #if true it will go to function return(d) into abs
    else:
        return("Nope") #if not true will go to function return to show Nope

try this code,i think its simply to understand


#8