More interactive environments are easier to learn, but the text based ones I have seen lately don't let you change your mind.

I have used Read–Eval–Print Loop (REPL) environments. However these are not suitable, as it is not possible to edit or view code that one wrote earlier.

```
In [1]: a=5

In [2]: b=a/3

In [3]: b
Out[3]: 1.6666666666666667

In [4]:

```

they are of some value. However it becomes less useful when creating something big, when creating routines.

I want to be able to create sub-routines interactively, and then be able to inspect them, and edit them. It also needs to be easy enough for teaching beginners.

```
In [4]: def double(a):
   ...:     return 3*a
   ...:

In [5]: show double

    def double(a):
        return 3*a

```

[![image showing what happens when user types edit double: editable code apears](https://i.stack.imgur.com/NWUad.gif)](https://i.stack.imgur.com/NWUad.gif)

```
In [7]: show --all

    def double(a):
        return 3*a

    def oneMoreThan(a):
        return a+1

```

**I am not too worried about language. I am just looking for a nice interactive learning environment, that combines the best of REPL and editing. Can you tell me of anything that you use or know of?**

I will add an answer that shows what I have found, but it is not an acceptable answer as I don't think it is easy enough.