Review build in functions


ef distance_from_zero(thing):
if type(thing) == int or type(thing) == float:
    return abs

    return "Nope"
what did I do wrong


abs is a function. What you are returning is the string representation of it, not a value. Invoke the function on your number.

return abs(number)

thing is a poor name for a variable. Yes, a number might be called a thing, but wouldn't it just be simpler to call it what it is? number, or simply, n?


Ok, I'll try to do that


There's another error


Too much indentation on else:. LIne it up with the if.


Ok, thank you, that worked


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