How do I format code in my posts?


Codecademy Discuss posts are parsed with Markdown. Markdown allows for easy formatting of code and text, and strips HTML out of posts by default to prevent security risks. This will show you how to format your code so it shows up.


To format code so it's visible, either wrap it in single backticks (`) for a small amount of code, or triple backticks on an otherwise blank line before and after for a large amount of code.


Inline code

To indicate a small span of code, wrap it in backticks (`). For example:

How do I use the `console.log()` function?

would produce:

How do I use the console.log() function?

Code Blocks

To indicate a code block, either wrap the entire block in three backticks:

<!DOCTYPE html>
    <!-- metadata and external resources-->
    <!-- page content -->

Or, (2) you can indent the code with four (4) spaces:

    <!DOCTYPE html>
        <!-- metadata and external resources-->
        <!-- page content -->

The first produces:

<!DOCTYPE html>
    <!-- metadata and external resources-->
    <!-- page content -->

The second produces:

<!DOCTYPE html>
    <!-- metadata and external resources-->
    <!-- page content -->

For more information on Markdown Formatting, visit or

Python coding help
7. Adding images
Cannot Figure Out How to Format This
What is wrong with my code?Unexpected token else Help?
Saving data lesson 4
Is prime
What's the difference?
Else if statements
Prompt not allowed in some lessons?
Trim whitespace
Lists and functions: using a list of lists in a function giving indentation error
How is everyone doing error
The Big If
The Big If
8/15 how to replace something with nothing while keeping the string?
Help a newbie move on please :)
Set up the albums#show controller action in the Bass Music project
Problem with prompt task in Javascript lesson
"expected [Function" error
Pizza Shop Ordering System Python Course
5/15 factorial
3/11 help wont let me type in the console window
15. Same Page. unordered lists
Computing the Average - 5/9
CSS font-weight property
Remove_duplicates: I don't understand the given solution
HTML Basic Lesson 15/17
Why does it say "food list"?
El editor funciona mal cuando escribo caracteres del teclado espaรฑol
Lesson 4/16: information needed
7/13 this.props.7/13 this.props. Why do we have to include function in class definition, what happens if a function is outside of a class passed as props to other component?
Could somebody hepl me pezl
Comma Separated List
JavaScript error: Uncaught SyntaxError: Unexpected end of input
Covering Losses
What;s wrong with my code?
6/7 code won't run
What is wrong with my switch statement?
Font weight bold
Identifying Rotten Strawberries
How does a function work
Return II , followed instructions to the dot, but still having problems
Simple Array Question on LOOPS BUT i'm mostly NEW to this
Good code throwing (not a syntax) error - help please!
My earth pathway won't show up. What am I doing wrong?
Link to destination
[Challenge] Print Times Tables ๐Ÿ–จโŽ
8.images- image not appearing-help! :/
[Challenge] Find the Missing Number ๐Ÿ”Ž
Essential Information on Code Challenges
[Challenge] Flatten an Array โ™ญ
Common elements Exercise 11/15
Error in Functions! - Pizza getTotal
What's wrong?
4_ Can I see your references JS Object ll
[Challenge] Calculate Max, Min, and Averages ๐Ÿƒ
Functions > Return || (6/7)
Just weight and see
Divid and conquer
Problem in 6/18 - more on __init__() and self
Python Lesson: Functions (19/19)
Escaping Characters
11.Making a purchase(need help!)
[Challenge] Stairmaster ๐Ÿ“ถ
What did I do wrong?
Just Weight and See
[Challenge] Comparative Weights โš–๏ธ
[Challenge] Egg Dropper ๐Ÿฅš
[Challenge] Change Please
Bug? ( stock doesn't look quite right!..)
Hello everyone! I am stuck at Adding Style.Can someone help please?
[Challenge] Product of Everything Else
Pygame help
[Challenge] Select a number, any number functions NEED HELP
[Challenge] Top Score Sorter
[Challenge] Palindrome Detector
[Challenge] Palindrome Detector
The Big IF
[Challenge] Fibonacci Finder
Pull It Together: Weird Indentation error
How do I move the navigation bar up on my code!(And move it to inline)
Interactive Website: Flipboard example error
Fizz_count(['fizz', 'buzz']) returned 0 instead of the correct answer: 1
Help with CSS for Course assingment : Nav section background color not showing up
[Challenge] Reverse Words
A bug about: Exercise 5-The CSS Setup (Learn HTML&CSS)
Stuck on -- Links and text decoration
Codecademy code does not work
Median returns [1] instead of 1
[Challenge] Anagram Detector
Please help me to correct my code
[Challenge] The Classic FizzBuzz Challenge
[Challenge] Unique Characters in a String
Confused by step #10
Review Functions
# 5 show a tag
Practice makes perfect
Stuck on 23
CSS Please help!
Uncaught ReferenceError: letterColors is not defined and Oops, try again. Make sure you have defined all the variables!. please help me
Pull it Together
12. Stocking out. Plz help!
Part of whole
Return original
<!DOCTYPE html> <html> </html>
How to Use the Codecademy Discuss Forums
Quick Tips for Writing Good Posts
CSS: An Overwiev, point 9
'return' outside function
Adding Jquery dropdowns to header
Can someone help me with adding the Unordered list?
How is Everybody Doing?
Just Weight and See: Student Becomes the Teacher
Is_prime Practice Makes Perfect is_prime(2)
Help! Hey, you never Know? But i don't
Not again
Hide... doesnt seems to be recognising my functions
Stocking Out - Wrong Total
NotAgain "Syntax Error, Invalid syntax
29. Try it Out!
Background won't change to brown
Part of the Whole
Link coding
Word input
CSS: An Overview A font of knowledge I NEED HELP CHANGING THE HEADERS
15. Median
Doesn't set opacity to 1
Just weight and see help
Exercise 5 how do you do it?
Danger, will robinson
Part of the Whole problem
12. Check yourself before you Wreck yourself. HELP!
Oops, try again. double_list([0, 1]) returned [0, 1] instead of [0, 2] getting this error
6. Is this a trick or something
Need help please.There is an error,but where?I have tried a variety of methods
9. something of value
Your own while / else
Just Weight and See Error
Lesson Number One
Practice makes perfect
Is_Prime(9) doesn't show the correct result
Stuck on Practice makes perfect
Pull it Together returns to non-number value
Stuck in Hello Sass nesting 5/9
How's everybody doing?
Scrabble - help please
Taking a Vacation: Indentation Error
Custom Print 5/19 Battleships!
A Real Win
Using a list of lists in a function. (I know its new years day but I think I'm quite close)
Play it! Sam
Social Network - paragraph doesn't work
Shopping at the Market, What am I doing wrong?
5/7 Pull it together (Taking a Vocation)
Got confused in 2/15 compare closely
Just Weight and See
It's Okay to be Average
Oops, try again. Your choices are not random enough. Try running it again
Get_class_average() not working, no idea why
7. Reverse - not sure what is wrong with my code
How do you add a link in 6/15? i'm terribly stuck
Declare dictionary in List
Why doesn't this work?
What's wrong?
Whats wrong in this?
Built_in functions
Dictionaries.update({key:value}) option
My own while/else 8.19 please help me!
4. The sum of scores
Pyg Latin
3. getting there
For the Record
Is anyone here? I need help. Is this an internal error? Seek to save
8.Part of the Whole Please Help
Pyg latinnnnnnnnnnn HELP
Image attributes for visually impaired
Before we begin
Why it say that the result is not defined although i have assign some value to result?
7. Reverse
Stocking out
18. Using a list of lists in a function
Name = raw_input("What is your name?") quest = raw_input("What is your quest?") color = raw_input("What is your favorite color?") print "Ah, so your name is %s, your quest is %sand your favorite color is %s" %(name, quest, color);what wrong in this code?
Floating left and right
Bug in HTML Basic Session II: 8. Fonts
Struggling with the flow of my code. layout issues
8: Part of the Whole. What am I doing wrong?
Part of the Whole - code return correct results but still get error message
Using a list of lists in a function
3. ...And the good! (can you help me !)
Practice makes perfect
Keeping up with produce: i dont get whats wrong
I had it solved: Your own while / else
7 More Link Attributes
Part of the Whole
What is wrong with the functions course? (python)
Bad aim
Pull it Together
10. Divs & classes - cannot reset
Did you declare a variable called name?
.friend class border
How do I format my code?
Am stocked at 5/13 - HELP MOVED TO 8/13
In lesson 7/13 photo is not opening and after click on run it show Did you use second image URL?
About this thread:
My title never appears
Functions Calling Functions, it says im right but it feels wrong
Why isn't this working?
Is the Final / Finished code available for comparison?!
Building Useful Classes - Why is this wrong?
Html & css Lesson 13 HELP!
Self closing tags part 2/18
Chech it twice! What is an exact code? I don't understand
<!DOCTYPE html> error
Need plain simple straight forward simple to understand formatting instructions
ArrayList String problem
10. Ending up Pyg lating
How to ask a question in our guide
5/7 for loops inside of for loops
PLS help with my simple asssignment, a guessing game in python
PLS help with my simple asssignment, a guessing game in python
26. link and text-decoration
How is this supposed to look with one parameter orderCount
Javascript, 'for loops inside for loops '

Pinned it up so learners see this topic and hopefully will format code when posting :slight_smile:

Please someboby help me

2 posts were split to a new topic: How do I format my code?

Part 9/9 error : "One of the following is missing or broken.."
Issues with 'stocking out'
The Big if
What am i doing wrong?
Cannot get print/put; cannot get rid of the black screen. experienced similar with lesson 3, finally skipped it