2. Funtcion Junction



Your syntax looks a bit off. Double check your parentheses and colon!

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

print spam = """Eggs!"""

# Define the spam function above this line.


You didn't define a function...

You were also told specifically to leave the line that says spam() alone... you added Eggs.


I don't know what I need to do


@bibleman13 could you help


You need to define a function. The syntax for functions in python is:

def function_name():
    do something


Also... if you haven't already, please read all of the instructions for this exercise. It not only explains how to define a function, but also, how to add comments to your code.


@jasminepatterson aquaphonenix has you going in the right direction! Basically for this lesson, you need to do 3 things: 1.) create a function spam, 2.) this function spam must print "Eggs!", and 3.) you must include a comment of your own choosing. Also, don't forget to define the function at the end. So first, lets create the function. As @aquaphoenix17 kindly gave you a basic outline of a function you should be able to do all the above steps. For the comment, I believe you can place it anywhere. I placed mine between my spam function and my print statement.


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