Functions 19/19. This doesn't seem right


#1
def distance_from_zero(n):
	if type(n) == int or type(n) == float:
		return abs(n)
  
	else:
		print "Nope"
    
distance_from_zero(-20)

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’”


#2

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


#3

Ahhh, a rookie mistake. Thank you!


#4