You don’t always need a laptop or desktop computer to write and run code. Take Dcoder for iPhone for instance: it is a mobile IDE with support for over 35 languages. It has a rich text editor with syntax highlighting and lets you write code in C, Java, Python, C#, PHP, Ruby, Go, R, Perl, HTML, CSS, Swift, and many other languages.
The app comes with convenient features such as line numbering, auto indentation, and auto-completion. You can always test your problem solving skills by taking on the algorithmic challenges available in the app.[where to get it]