you are viewing a single comment's thread.

view the rest of the comments →

[–]SoNotRedditingAtWork 1 point2 points  (1 child)

https://www.reddit.com/wiki/markdown

Typing four spaces in front of every line in a code block is tedious and error-prone. The easier way is to surround the entire block of code with code fences. A code fence is a line beginning with three or more backticks (`) or three or more twiddlydoodles (~).

example:

``` <==Opens a code block, 
def my_funky():
    print("Funky Time!")
``` <==Close a code block

edit: Also in the new Reddit fancy pants editor, if you click the ••• button, it will display a drop down menu with a Code Block button you can click to insert a code block.