Review: Built-In Functions


Your function seems to fail on input True when it returned '1' instead of 'Nope'

 def distnace_from_zero(s):  
     if type(s) == int or type(s) == float:
         return abs(s)
         return 'Nope'

I am 100% sure that my code is correct, nevertheless; I wonder if others have seen the same problem and how did they solve It?



Did you mean to write, distance_from_zero?


Yes, that's a typo error. It should not matter for the computer.

I managed to solve the problem, thanks for the help.