The cost of professional tools
You severely under-estimate the availability of free tools. Software development is an industry with a wealth of completely free tools that professional developers use every day.
Free things that I use regularly in my job as a developer:
- git (Source control, the major thing you're looking for here.)
- Notepad++ (An excellent plain text editor on Windows)
- A large number of Python packages (flask, SQLAlchemy, click, pyparsing, attrs, setuptools/pip, requests, and many more)
- Linux (various distros, e.g. Debian, Centos)
- Chrome with Dev tools or Firefox with Firebug
- SQL Server Management Studio
- Oracle SQL Developer
- SchemaSpy (old, but still free)
Okay, you have to have Windows for some of those, which isn't free, but not for most of them. And chances are you have a Windows computer somewhere or can find a non-Windows equivalent.
A lot of software has paid and free versions, too, and very often, the free version is fully featured enough to be useful. Some examples:
- SQL Server (Express = free)
- PyCharm (Community = free)
- Visual Studio (Community = free, mostly)
I hope you can look over this list and see that you can pretty much put together and entire application stack without paying a dime, and all of them can be installed and run on your local machine. Plus, I'm only scratching the surface with the things I personally use regularly, as a professional. The only thing that's hard to find for free is hardware, but there's even a few options on that front for web hosting. (Heroku is one example.)
Not losing your work
To start with, you need to work locally. Start using an editor to save your code files to disk. A number of editors will even "save" working copies that can be recovered if the program crashes. (The humble Notepad++ does this, even.) Download and install the runtime for the language you use. Use it to run and test your code.
You can use a full IDE or a plain text editor. If the language doesn't make it too difficult (like C# does, for instance), I generally recommend starting out with a plain text editor. You'll learn more about the process of how code runs this way, and that will make your life simpler later on.
If this isn't enough to protect your code, then...
Use source control
Source control allows you to maintain a history of your changes. You edit your files, and then you commit them. The software keeps track of what changes occurred between any two commits. Beyond just saving your changes, it also fills the roles of moving code (to servers or other developers' machines) and of integrating different sets of changes to the same files together.
For you, I highly recommend git. It's the dominant source control tool in the software industry right now, both professionally and non-professionally. While git is most commonly used with a server, its design allows you to just keep everything in one folder on your machine. If you want to preserve your changes somewhere other than your machine, look into git services that offer free repositories.
git can be a little hard to approach, so if you find it too difficult, you can consider SVN. It's much easier to learn, but it requires a server to run. You can run one locally, but it will probably be simpler to find a service that offers free repositories.
Free repositories are typically limited in some way, but given that you've been making do with repl.it, I'm sure you can find a service with limitations you can live with.
Something to consider is that hobbyists and professionals alike use source control. It's expected today for anything beyond the smallest of throwaway programs/scripts. So this is a necessary skill to have if you want to be involved in the development world at large (either socially or professionally).