This is a two-parter: first, define a function, distance_from_zero, with one parameter (choose any parameter name you like).
Second, have that function do the following:
Check the type of the input it receives. If the type is int or float, the function should return the absolute value of the function input. If the type is any other type, the function should return "Not an integer or float!"
So, here is the code I wrote...
def distance_from_zero(distance):
if type(distance) == int or float:
return abs(distance)
else:
return "Not an integer or float!"
yet, it says,"Oops, try again! Your function seems to fail on input True when it returned '1' instead of 'Not an integer or float!'"
Please spot the mistake...