Stuck in Review:built in functions


The code i have written is right,atleast i think so.but it displays the error message
Oops, try again. It looks like you have a NameError. Maybe you forgot to create a function called distance_from_zero? Check the error message for more info! - global name 'nope' is not defined

def distance_from_zero(number):
    if type(number)==int or type(number)== float:
                     return abs(number)
        return nope


nope should be a string, not a variable


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