This app was mentioned in 6 comments, with an average of 2.50 upvotes
I would like to talk about DroidEdit Pro.
I know it hasn't been updated in some time but it is still doing everything I need it for since I.bougjt it many many years ago.
For an editor, DroidEdit is pretty nice. If you want more than just an editor (for example, some way to actually run your code), you might have to look into how this is done on iPads (basically, ssh'ing into another machine and editing/running code on a remote machine), either that or look for something web-based (as has already been suggested).
You could also try something like termux which apparently allows you to apt install python
to get an interactive python shell (and presumably run scripts locally). I'm sure this has limitations though.
I code on my phone sometimes when I'm bored, I recommend DroidEdit. It's pretty customizable, and can integrate with Google Drive and Git servers. A Bluetooth keyboard makes a nice addition.
It depends on what you want to do. Do you just want to touch up some HTML/JS/CSS on the go, or maybe you want to work on the backend?
I used DroidEdit Pro the last time I wanted to touch up some code from my tablet. It's been years, though, so I don't know how well the app has held up.
You might also look into running a terminal emulator and using vim or emacs.
Something like this: https://play.google.com/store/apps/details?id=com.aor.droidedit.pro ?