Medium supports code blocks and inline code tags.
To begin a code block, on a new line type in ``` (triple backtick).
Keyboard shortcut: ⌘ + Opt + 6 / Ctrl + Alt + 6.
For inline code in a paragraph, type a single backtick ` to begin and end your code. Or highlight some text and press the backtick key.
Note: Code blocks and inline code are not supported on mobile.
Medium code blocks do not support syntax highlighting. To embed code with syntax highlighting on Medium, try Github Gists, Codepen.io, or JSfiddle. Paste your snippet URL from one of those sources to a new line in the editor and press Enter. Learn more about embeds.