Help


#1

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


#2

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!"

#3

Hi @baileysmith,

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

spam()

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.


#4

def spam():

print "Eggs!"

#5

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

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

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


#6

thank you appylpye.i done it


#7

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