# Code blocks in Markdown

> How to write inline code and fenced code blocks in Markdown — and why fencing keeps AI from mangling your snippets.

## Inline code

Wrap a word or two in single backticks to format it as code, right inside a sentence.

```markdown
Run the `print()` function.
```

## Fenced code blocks

For multiple lines, put three backticks on their own line before and after. Add a language name after the opening fence for syntax highlighting.

```markdown
```python
print("Hello, AI")
```
```

## Why it matters for AI

Fences tell the model "this is code, read it literally" — it won't reflow your indentation or turn straight quotes into curly ones. Always fence commands, JSON and config.

:::tip
Name the language after the opening fence (```json, ```bash). It sharpens highlighting and tells AI exactly how to parse the block.
:::
