Stuck in Review:built in functions


#1



https://www.codecademy.com/en/courses/python-beginner-c7VZg/4/3?curriculum_id=4f89dab3d788890003000096


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)
                
    else:
        return nope


#2

nope should be a string, not a variable


#3

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