How to run python script on website that do some computation and gives the output on web?

I have to build i website where user will upload a python function then some dataset will be parsed through it and some other computation will be performed on it and the output need to be displayed on web. Where and how should these python script needs to be placed? please help me with some approach?