What is wrong with my code


#1

here's my code

def distance_from_zero(m):
if type(56) == int or type(54) == float:
return abs(-9) abs(-10)
else:
return "nope"


#2

Change 56, -9, and 54 all to m, and get rid of abs(-10). Last of all Make the n in nope capitalized.


#3

You don't have to fill numbers in to complete the course. Here is my example.

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

As you can see I used the argument instead of using a number. What you are doing is calling the argument to see if it is a int or float. Thats why the numbers wont work. Try to replace the numbers with the argument (m) and remove one of the abs() and see if that helps.


#4

thank you for the help it worked!!!!!!!!!! :smiley::smiley:


#5

My code (which is not working) is

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


#6

change the capital n in Nope to a lowercase n