Review Built in functions. What is wrong?


#1

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


#2

Hi,

if type(o)==int or type(o)==int or float:

Are you trying to check here wether the type of "o" is an int or a float? In that case you would need to use

type(o) == int or type(o) == float