Can I use python to code in web development .
Yes, its possible. There is flask (micro framework) and Django which comes with all the bells and whistles.
But it doesn’t really matter, once you gain some experience, you can more easily learn other languages and frameworks. Pick the right tool for the job, don’t force a tool on a job it isn’t designed for