Function Junction


#1

Can someone explain why I'm stuck here?????????

def spam():
    """XXXXXX"""
    print "Eggs!"

#2

Hi bmastrandrea,

I copy/pasted and submitted your code in exercise 2/19 and it worked perfectly.

What error message are you seeing?


#3

@bmastrandrea,

As happened with @albionsrefuge, your function worked correctly when I copied and submitted it. But, your post omitted the following line, and in fact, if you removed it from the code that you submitted, it will not pass:

spam()

That statement calls the function, so that it produces the output.


#4

oh, ok thank you all


#5

i still don't get it…


#6

Remember to put the code above the line where it says write your code above


#7

the 'spam()' at the end calls the (def)ined function called spam and does that code so it will run the 'spam' and print out 'Eggs!"

def spam():
    """XXXXXX"""
    print "Eggs!"
spam()

#8
  1. # Define your spam function starting on line 5. You
  2. # can leave the code on line 11 alone for now--we'll
  3. # explain it soon!
    4.
  4. def spam():
  5. """Prints 'Eggs!' to the console"""
  6. print 'Eggs!'
  7. # Define the spam function above this line.
  8. spam()

It's telling you to define the Function on line 5, so after line 8 just type" spam() ".


#9

don't delete and paste put it on line 6 and paste