Yes. There are many python web frameworks like DJango which lets you do that.
If you don't like to get into the advanced frameworks now, you can check out a simple python http server code that simply outputs html. Try it on your machine.
In this code, I simply returned a html code that has images in it using python