Search for a useful interactive programming environment 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




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.
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?


Runestone Academy has a component called ActiveCode that allows you write Python code and run it. It also has a slider so that you can go back to earlier versions of your source code to review and run.

In addition to activecode, you can also execute Python code with the assistance of a unique visualization tool. This tool, known as codelens, allows you to control the step by step execution of a program. It also lets you see the values of all variables as they are created and modified. 

There is a lot more to the web site but is what I use to help others learn Python 3 and the nicest part is that once the students get the hang of the e-books they tend to take off at their own pace.