10. Review: Built-In Functions, I don't know what's wrong


#1

this is the co
def distance_from_zero(s):
if type(s) == int(s) or float(s):
return abs(s)
else:
return "Nope"
can someone fix this code?
the error is:
Oops, try again. Your function seems to fail on input True when it returned '1' instead of 'Nope'


#2

you need to do comparison at both sides of the or opetor


#3

did you fix it. i have problems with it too.


#4

if you want help, please make a new topic


#5

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