19. Review: Built-in Functions || Help Please


#1



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


File "python", line 1
def distance_from_zero(dfz)

SyntaxError: invalid syntax

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 'distance_from_zero' is not defined


Well, I don't understand when it says 'distance_from_zero is not defined' as I have defined it.


def distance_from_zero(dfz)
    if type(dfz) == int or type(dfz) == float:
        return abs(dfz)
    else:
        return "Nope"


#2

at the end of a function declaration should be a colon to mark the start of the function content:

def example(parameter):

the colon (:) is missing in your case


#3

That would be a good reason as to why it won't work. Thank you


#4