My tariff, which is free, stops working after some time, what is this?

I want to buy the paid version, but what if the same problem occurs there? Or why this happens. The code is known to be correct.

How are you running your code on PythonAnywhere? If that's in a Bash console, the behavior you see is a correct one, as our consoles are ephemeral by design. If you need a long running job, check our Always-on task feature.