Here is my code...

def distance_from_zero(number):

if type(number) == int or float:

return abs(number)

else:

return "Nope"

If I submit this code, I get this response.

Oops, try again. Your function seems to fail on input True when it returned '1' instead of 'Nope'

If I change type(number) == int or float to type(number) == int or type(number) == float

I get the correct answer, but I don't understand why my original code was wrong.

Could someone explain to me why?