Python Code Formatting

Hello there. How do I add python code formatting to a website.
I have a line that says ‘print(“hello world”)’
I try to format it by putting

print("Hello World!")

– but that does not work. I’ve also tried py, python, and ```py3.
How must I format python code on my posts? Thank you.

Nevermind, I’ve got it working – simply go into the plain editor and put ‘python’ after the tildes, in this way:
print(“Hello World!”)