I doubt this is intentional – it‘s syntax highlighting, which in this case was added automatically when the question was tagged [tag:python], see [its Tag Info page](https://askubuntu.com/tags/python/info):

> Code Language (used for syntax highlighting): lang-py#

The [syntax highlighting help page](https://askubuntu.com/editing-help#syntax-highlighting) explains how one can add this highlighting to one or all code blocks.

Further reading:

- [Help on syntax highlighting](https://askubuntu.com/editing-help#syntax-highlighting)
- [meta.SE post explaining tag-based syntax highlighting](https://meta.stackexchange.com/questions/72082/changes-to-syntax-highlighting)