It should work to an extent on a mobile device, but I can't imagine how to make it a good user experience while actually coding. A tablet should be okayish, it's just not optimised for that. Typing code on a phone sounds awful.
For anyone who really wants that I recommend https://grasshopper.app/ to learn on the go while dragging and dropping, but this comes with serious limitations.
Ultimately I don't know what the long term plan is for someone without a desktop device. Do people write full programs on mobile devices? Is it easy enough to install external dependencies? To build and package software for release?