Review built in function


#1



def distance_from_zero(n):
if type(n) == int or type(n) == float:
return type(n) == abs
else:
return "Nope"
error message :Oops, try again. Your function seems to fail on input -10 when it returned 'False' instead of '10'


Replace this line with your code.


#2

if nis a integer or float, return the absolute value.

You check if the type of n equal abs, and return this result


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.