Function Junction easy question


Go ahead and create a function, spam, that prints the string "Eggs!" to the console. Don't forget to include a comment of your own choosing (enclose it in triple quotes!).


def spam():
    """doctrine quote"""
    return "Eggs!"
    print "Eggs!"

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

I've been trying with return, with print, and both. Nothing works.



You are told to only print "Eggs!". So you have it as:

def spam():
    """doctrine quote"""
    print 'Eggs!'

Then, you also need to call that function, to have:

def spam():
    """doctrine quote"""
    print 'Eggs!'

Hope this helps! :wink:


Thank You, closed question.


yup worked ...u need to close the define function


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