[How to] Format code in 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

Toolbar Icon
Using Preformatted Text icon on the toolbar

This will automatically create a code block which you can paste your code in.
Or select your code and then press the icon.


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 daringfireball.net or commonmark.org.

7. Adding images
How can i change the style of color
I need help
Saving data lesson 4
Working with Python List: Medical Insurance Project
10. Divs & classes - cannot reset
Social Network - paragraph doesn't work
How do you add a link in 6/15? i'm terribly stuck
7 More Link Attributes
<!DOCTYPE html> <html> </html>
Return original
Self closing tags part 2/18
Html & css Lesson 13 HELP!
Project thread shed i python programing
Stuck in Hello Sass nesting 5/9
Is the Final / Finished code available for comparison?!
In lesson 7/13 photo is not opening and after click on run it show Did you use second image URL?
My title never appears
How do I format my code?
CSS Please help!
12. Check yourself before you Wreck yourself. HELP!
Exercise 5 how do you do it?
CSS: An Overview A font of knowledge I NEED HELP CHANGING THE HEADERS
Link coding
Stuck on 23
Background won't change to brown
Floating left and right
8: Part of the Whole. What am I doing wrong?
Can someone help me with adding the Unordered list?
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?
[Challenge] Unique Characters in a String
[Challenge] The Classic FizzBuzz Challenge
[Challenge] Anagram Detector
A bug about: Exercise 5-The CSS Setup (Learn HTML&CSS)
[Challenge] Reverse Words
Help with CSS for Course assingment : Nav section background color not showing up
Image attributes for visually impaired
[Challenge] Egg Dropper πŸ₯š
[Challenge] Change Please
[Challenge] Comparative Weights βš–οΈ
[Challenge] Print Times Tables πŸ–¨βŽ
JavaScript error: Uncaught SyntaxError: Unexpected end of input
Return II , followed instructions to the dot, but still having problems
[Challenge] Stairmaster πŸ“Ά
Font weight bold
6/7 code won't run
Link to destination
What;s wrong with my code?
Divid and conquer
Functions > Return || (6/7)
[Challenge] Calculate Max, Min, and Averages πŸƒ
[Challenge] Fibonacci Finder
Error in Functions! - Pizza getTotal
Comma Separated List
Common elements Exercise 11/15
Could somebody hepl me pezl
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?
[Challenge] Flatten an Array β™­
Essential Information on Code Challenges
[Challenge] Palindrome Detector
[Challenge] Find the Missing Number πŸ”Ž
8.images- image not appearing-help! :/
[Challenge] Palindrome Detector
HTML Basic Lesson 15/17
"expected [Function" error
[Challenge] Top Score Sorter
Problem with prompt task in Javascript lesson
Set up the albums#show controller action in the Bass Music project
CSS font-weight property
26. link and text-decoration
Javascript, 'for loops inside for loops '
17.review functions NEED HELP
[Challenge] Select a number, any number
Else if statements
What's the difference?
How is this supposed to look with one parameter orderCount
15. Same Page. unordered lists
Pygame help
Quiz in java script
[Challenge] Product of Everything Else
PLS help with my simple asssignment, a guessing game in python
PLS help with my simple asssignment, a guessing game in python
5/7 for loops inside of for loops
ArrayList String problem
Python classes
Poker tournament app
WELP project (task 8): Guidance for using WITH and JOIN in SQL
Help I need some help with my program!
Nested If statement returning other blocks?
FAQ: Learn HTML - Intro to HTML - HTML Structure
Please help omg i've been doing this for sooo long :'(
Reduce method - Bild a Library
Parts of my code, where I have comments, go bold
JS challenge sublength()
Position:fixed; is making my navigation bar disappear
Task Board Project
My Edit of Mysterious Organism (JavaScript Object Challenge)
Python, how to replace a text from a file between two tags?
Name 'x' is not defined. in pygame
Grade Analyzer: methods for the lowest or highest class grade
What's JavaScript Thinking Here?
Need help please, can't make return or variables
Problem Solving
JavaScript Interactive Websites - Chore Door Project
How can I access a dictionary key value inside of a loop?
How to ask a good question
[Challenge] Anagrams
Escape keys
FAQ: Natural Language Parsing with Regular Expressions - Review
How to share projects?
FAQ: Semantic HTML - Audio and Attributes
Plz help me
Help me i got a syntax error and I'm not sure what I missed
Meal Maker undefined and NaN
Why Does This Print Statement Not Execute?
Someone please let me know where is the error in my code
6. Is this a trick or something
Hurricane Analysis Project - Areas Affected Dictionary creation
CSS Grid + Fixed Position (aka "keep the nav bar when scrolling")
Am stocked at 5/13 - HELP MOVED TO 8/13
<!DOCTYPE html> error
Does anyone know why in the constructor (self.full = name + version ) why name + version doesn't have to be self.name + self.version?
Can anyone give me some tips on making this liltle program smaller
Need plain simple straight forward simple to understand formatting instructions
Why not working
Why won't my counter loop work?
FAQ: Learn Bash Scripting - Review
JAVASCRIPT SYNTAX, PART I / NOOB / If, else if syntax
Python magic 8 ball
Connect Google Font
Sleep Debt Calculator – My code works, but it is saying undefined
Advanced Python Code Challenges : Control Flow
How does `edit_message` know to reference the `Message` class?
Hey im new to learning python and im having trouble solving this assignment can you guys help me>?
Why always begin new lines with std: :cout<<
Homework java
Website Project for school
True or False? project
LOOPS Same Values
If elif for Grade Convertor
Rock, Paper & Scissors Project - Error message
Can someone explain this practice question for me?
Message Mixer Super-encoder undefined
Does this achieve the same thing?
Manipulating Functions
JavaScript - Functions: Rock, Paper, Scissors - Which is the utility of : else { return 'text'; }
Return error on loop code challenge 5/11
Project Review Please provide the review on my code thanks
Print a function with a print statement in it
Animal Fun Facts Task 9
Bordeless Tourist Challenge
List printing itself three times over whilst not in a loop
Image bottom resize
Blossom Project
Create Purchasing Information and Receipts for Lovely Loveseats Python
Noob coding question
Jammming currentTrack & savedTrack undefined?
Try block in "The Boredless Tourist"-challenge failing
Race Day -
Mole Unearther Step 16
Wanderlust - multiple syntax errors
Fotomatic project
Number Guesser Challenge - what's wrong with my code
Meal maker - Cannot read property 'length' of undefined
The Boredless Tourist
Magic eightball project
Project: Kelvin weather need help
Having a problem with some code
What is wrong with my code pls?
Learn React Course not recognizing that I'm finished with a section
FAQ: Linked Lists: Python - Linked List Implementation III
FAQ: Taking a Vacation - Plan Your Trip!
FAQ: Learn Java: Methods - The toString() Method
Credit Card Checker : some issue with my code
FAQ: Code Challenges: Intermediate JavaScript - isTheDinnerVegan()
Please check and advise other ideas or options
Rock, Paper, Scisssor - Issue JS
Number guesser project
Why can't I use object name directly instead of 'this' keyword?
Dasmotos Arts & Craft project background image not loading
findInvalidCards - CREDIT CARD CHECKER Project
Help on "WorkAround Explorer" Project in Modules section
Codewars - Kata problems
Looping list students_period_A to combine students_period_B
New_input() not loading in console
How to get a sum during a loop
Need to fix slideshow and figure out responsiveness. only CSS/HTML
Help!Medical Insurance Project
Rock Paper Scissors question bracket quesiton
Magic 8 ball project question - Why $userName not being recognized?
[Extreme] Tolerant String Matching Python Challenge (not for beginners)
Mixed Messages: Bad Advice generator
Thread Shop
Help finding a way to calculate tip for my shopping cart
Mysterious Organism Project Issue
Rock,paper,scissors project
Saving changes using Localstorage for currency switcher
Stuck with this code and the number Fahrenheit and newton. doesn't come up in my output. Please help
Meal maker
Images don't fit - HTML and CSS question
Sleep debt Calculator
Creating a digital contact book- Guidance needed
Codecademy meal-maker project
Question about Magic Eight Ball project- Result printed out in console.log
Legnth property problems?
Help with adding 2.5 to 2d list
Introduction to Functions: Why Functions? Slide 2
Need help in understanding iterations in linked list
Why not working
Console.logging [ i ]
U.S financial Health Project. DATETIME ISSUE
Have a look at my take at Sal's shipping without using functions
Feeling irritated and frustrated
JavaScript Rock Paper Scissors
Jamming Project not working
Arrays and Sets - Palindrome.swift Project (Swift)
Wanderlust step 14
Why my program not working properly.. please help me
New York Fashion Week HTML Project Errors?
Magic 8 Ball - Always the Same answer
New student
[Fixed, dont worry]
Python The Bordless Tourist Project
Background-image showing white borders
Why do I get a "false"?
Rock Paper Scissors Game
Magic8.py ......Ok, my if statement comes up as a indentationerror: expected an idented block
Help with Build a Library project
Question about Newton exercise in JAVASCRIPT SYNTAX, PART I
JS Syntax Error - No idea as to how to identify the syntax error or what it is?
React Jamming - Step 42 TypeError Problem
Create a Front-End App with React Skill Path(ravenous 1 part)
React hooks won't work in free workspace
Why is it when I attempt to Math.floor(newton) the output in the console log does not change from being a decimal?
Javascript Practice
About which error will display
My own code
Error help TypeError: 'int' object is not callable
Rock, paper, scissors
Loop question about the Python 3 coding challenges
Appointment Planner - Changes not being shown
Data Science Path: Python Portfolio Project US Medical Insurance Cost
Jammming (Cannot read property 'map' of undefined)
Introduction to Functions: Why Functions? Slide 2
Dog Years - console.log
Template<typename T> isn't working
Autoplay video attribute not working
Jamming Project 403 Error and 404
Jammming (Cannot read property 'map' of undefined)
Dasmoto's Arts & Crafts project images issue
Meal Maker - push undefined
Calculating Total Within a Loop
Php doesn't work
Reggies Linear Regression
JavaScript, Conditional Statements (&& and ||), Why Does This Work This Way?
Error: expected β€˜;’ before β€˜}’ token }
Food for thought: What are the numbers for all 4 teams?
Javascript Rock, Paper Scissors Project Determine Winner Function Not Working
Cube Matcher... problem around Step 13
Python Terminal Game Issue
Rock, paper, scissors
Npm install error
Average of rows
Cube Matcher: Step 13-15
FAQ: Learn HTML - Common HTML Elements - Linking to Same Page
I am using images for links and it's giving me trouble?
Fundamentals of HTML-Fashion blog
My code doesnt appear in the browser Animal Fun Facts exercise
Jamming project help
Python - Nested loops
FAQ: Learn HTML - Common HTML Elements - Linking to Relative Page
JavaScript Practice: Data Types, Conditional, Functions
FAQ: Loops - Looping through Arrays
FAQ: Learn HTML - Common HTML Elements - The `<html>` tag
8ball project coding syntax error
Javascript magic 8 ball challenge
I installed React Developer Tools but changing the source of the App in VS Code does not reflect on the website
Rock, Paper, Scissors Project
I need help with the boredless tourist exercise
Quadratic Formula -Swift Lesson Project
Thread Shed - color count
BIT / RGB>Hex converter. Error "takes no arguments (1 given)"
FAQ: Compile & Execute - Compile and Execute
Passing Thoughts project
Playing a Youtube video in Visual Studio Code using HTML
Why div? What is it and what is it for?
Social Network for Pets
Disable JS for mobile devices
Magic 8-ball using if...else if
.friend class border
Bug in HTML Basic Session II: 8. Fonts
Is anyone here? I need help. Is this an internal error? Seek to save
CSS: An Overwiev, point 9
For the Record
FAQ: Conditional Operators - Review
4. The sum of scores
Dictionaries.update({key:value}) option