Player inputting code

Hello everyone,

I am creating a game where I am trying to teach players coding. Starting from the basics and moving forwards to more advanced subjects.
I want to give the players the ability to write code with directions and hints and then execute it in game and produce results (visual).
How would I go about doing that? Where do I start creating something like this? Is it possible?

You need to read about interpreters and scripting languages, and how all this work.
It is possible, not easy.

Also for inspiration you can look game Space Engineers, they have programmable block which allow execute code(C#) which player wrote, its very limited.