I'm literally new to programming world and python is my first language. For a work i wanna use GP tools in a web page which will run basic operations on published layers.
Is it possible; if so how then ?
One way is to publish your tool to an ArcGIS Server. Once it's published, it can be consumed using different APIs, like JS API, depending on how you want your web page to set up. Also, you can use it in WebApp Builder, or even the developer edition if you need to go further.
There are many standard analysis tools, and raster analysis tools, built-in with Portal for ArcGIS, depending on your license. This can be a much easier approach, if your analysis is very straightforward.
Retrieving data ...