Function Junction


#1

def spam():
"""Prints eggs"""
print "Eggs!"

error with Oops, try again. Make sure your function prints "Eggs!" to the console! help me plz )


#2

I can't tell if you have used proper indentation since you didn't format the code in your post. But, the main problem here is you didn't call the function. You merely defined it. A defined function only runs if you call it.

In other words, assuming your code uses proper indentation, all you need to do is add

spam();

after and outside your function definition.


#3

Thanks for explanation.


#4

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