Built-In Functions Please Help!


#1

i dont know whats wrong?

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


#2

Your IF and ELSE statements should both end with a colon ( : )


#3

Yeah, but you definitely are a good programmer!


#4

it should look something like this:

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

the abs() must contain the variable that you put in the distance_from_zero(this variable right here)

Hope this helped!

Don't forget to indent the if,else, and the returns!!!