What's wrong with my code? I think it's all rigth


What's wrong with this code? Python returns error:

Oops, try again. Your function seems to fail on input True when it returned 'None' instead of 'Nope'

Code is:

def distance_from_zero(liczba):
    if type(liczba) == int or type(liczba) == float:
        return abs(liczba)
        print "Nope" 

!!! SORRY I'VE FOUND IT - return instead of print. 
Thanks anyway


Oops you got it. I'm always too slow. :grin:


Thanx anyway. It's good to know that you can count on somebody if you are in trouble.


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