This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Functions Forum

View Course » View Exercise

765 points
572347915917ec615700053d_397807894
Submitted by
Nikita Yerenkov-Scott
over 3 years ago

I am not too sure what to do?

Can any body help me as I don't know what to do?


-1 votes

permalink

You're defining a function called "spam" that will then be called later on in the program. Use the definition syntax described previously.

To get you started, here's what you need:

def spam():

After that, you'll tab over on the next line and start your docstring. This is just a string directly below the line that defines your function name. It's going to be enclosed in triple quotes (and the grader only seems to accept double quotes (") where Python would allow you to choose double quotes or single quotes (').

So, after you put that line above to define the name, go down to the next line. Tab over if the editor doesn't do that automatically for you. Type three quotes to start your doc string. Type a short description of what your function does. Then, go to the next line. You still want to be tabbed over once because you are now ready to type out the code block that will make up the functionality of your function. Then, just input a statement or series statements that will print the string "Eggs!" to the console.

I hope this helps. If not, ask some specific questions so we will know where you are having problems.

741 points
Cada1792e8ae0aa5902cecb179257fc0?s=140&d=retro
Submitted by
Devon Campbell
over 3 years ago

1 Comment

572347915917ec615700053d_397807894 Nikita Yerenkov-Scott over 3 years ago

It helped me, thank you.