Stuck on "Function Junction"


#1



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


I formatted my code EXACTLY like in the example, but it gives me this error:

File "python", line 5
def spam
^
SyntaxError: invalid syntax


My code should print the string "Eggs!" but the error says I have "invalid syntax", even though I formatted the code just like in the example.


 
# Define your spam function starting on line 5. You
# can leave the code on line 11 alone for now--we'll
# explain it soon!

def spam();
    print "Eggs!"
    """Prints 'Eggs!' to the console."""

# Define the spam function above this line.
spam()


#2

The block should begin with a colon, not a semi-colon.

def spam():

#3

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