Python is often used for exploratory programming. Often, the final result is not the program but an answer to a question. For scientists, the question might be “what is the likelihood of a medical intervention working?” For people troubleshooting computers, the question might be “which log file has the message I need?”
However, regardless of the question, Python can often be a powerful tool to answer it. More importantly, in exploratory programming, we expect to encounter more questions, based on the answer.
The interactive model in Python comes from the original Lisp environments’ “Read-Eval-Print Loop” (REPL, ...