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

its saying its not printing "Eggs!" to the console but I thought it was, plz help


I have a theory on what may be your issue. In python, everything within a function must be indented. This is what it should look like:

def spam():
    print "Eggs!"


Hi @baileysmith,

Do you still have this line in your code? ...


You need that line in order for your spam function to execute. Otherwise, "Eggs!" will not get displayed.

Place the line at the end of your code, and make sure not to indent it.

Also make sure your spam function includes proper indentation, as @sgt.schultz has explained.


def spam():

print "Eggs!"


The following lines of code are provided as part of this exercise ...

# Define the spam function above this line.

Remember not to remove that final line, otherwise, the spam function does not get called, and consequently, "Eggs!" does not get displayed.

Link to exercise: Function Junction


thank you appylpye.i done it


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