How do I format my content as a code block?


DataCamp’s editor uses Markdown to format your text so that it renders as code. However, "code" and "code blocks" render differently and, not surprisingly, it's because they are formatted differently.

If you wish to format a single variable or function name, surround your text with single back-ticks (located in the upper left on your keyboard). Your variable or function will then render like this variable  or this function()  

If you want an entire code block, you need to surround your code with three sequential back-ticks at the top and the bottom of the block. 

# This is a code block example
def my_func()

Just make sure you add a line break before and after your code, or your code block won't render properly.

Did this answer your question?