I will suggest using version control through something like github. You can have private repositories so you can keep your code private.
To that end, on iOS I would suggest the app called Working Copy. It’s reasonably simple to use and removes the need for arcane command line antics.
In pythonista you can open external files and then navigate to your working copy entry I. The files app.
On windows you can use github desktop as another ui based github client.
Good luck!