Review built in function


def distance_from_zero(n):
if type(n) == int or type(n) == float:
return type(n) == abs
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.


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

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


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