I've tried the usual markdown syntax, for example:
# Here's my Python code
But it doesn't seem to work, it just displays it literally as if it was plain text. I wasn't able to find information as to whether markdown was the right syntax, or if there's another one, or if there simply isn't one. But when it replies with code, it does display it in a proper format (monospace font and everything), so that seems to indicate that there might be a way.
Of course this doesn't hinder its comprehension of code in any way, it's just for me, if I want to review the conversation later.
I have also looked through ChatGPT's FAQ (as suggested in the comments), especially through these three pages:
But haven't found any additional information on how to format prompts.
There is a very recent discussion (dated February 21) exactly about this in the OpenAI Community -> Add markdown support to input bar.
So far there is no working solution / workaround, and there is no fuller explanation either.
Also there is a very recent discussion (dated February 13) exactly about this in the OpenAI Discord Server -> https://discord.com/channels/974519864045756446/1074756725695062096/1074764240063299584
On this conversation it is mentioned the case of of LaTex for Match formulas. So far ther is no workink solution / workaround, and there is no fuller explanation either.
Editor Note: I have tested using single backtick and triple backtick / code fences as the OP but they didn't work for me either.