What is wrong with this code


#1

def distance_from_zero(thing):
if type(thing) == int or type(thing) == float:
return abs(thing)
else:
return "Nope"

this code is not working why


#2

What does it do differently from what you want? "wrong" doesn't contain that information!
And make sure that we can see the intact code, yours seem to have lost a few things in your post.


#3

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