How to write code in a question/answer on a Stack Exchange site?
Before and after your code block press the ` (backtick) key followed by a blank space.
(Note: Do not mistake Backtick character and key ` with apostrophe character and key ') Thanks to @middaparka for the advice
Backtick key is here on most english keyboards:
(see Markdown Editing Help page)