ef distance_from_zero(thing): if type(thing) == int or type(thing) == float: return abs else: 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.
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,
Ok, I'll try to do that
Too much indentation on
else:. LIne it up with the
Ok, thank you, that worked
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.