Functions 19/19. This doesn't seem right

def distance_from_zero(n):
	if type(n) == int or type(n) == float:
		return abs(n)
		print "Nope"

Here’s my code, i thought that the would work absolutely correctly but the error code produced is this:

“Your function seems to fail on input True when it returned ‘None’ instead of ‘Nope’”


None is default returned value. When n=True your function indeed returns None. It prints Nope, but print and return are not the same thing


Ahhh, a rookie mistake. Thank you!