2/7 Functions


# 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():
    """prints "Eggs!" on the console"""
# Define the spam function above this line.
    print "Eggs!"

Oops, try again. Make sure your function prints "Eggs!" to the console!

What's wrong in this code? Please advice.


I also stuck in problem.Waiting for the answer.


@textplayer55728 @malwinaz Simply type the function 'spam( )' since it already includes a print method in the function.

Take a look at the correct code:

def spam():
    """ This program prints out "Eggs" """
    print "Eggs!"

# Define the spam function above this line.
spam()      #Include this line, this calls the function that prints out "Eggs!"


@leocrimson and @malwinaz Please always format your code. Here's a tutorial. Thanks! :slightly_smiling: