From the course: Python: Recursion

The concept of recursion - Python Tutorial

From the course: Python: Recursion

Start my 1-month free trial

The concept of recursion

- [Instructor] My grandma used to tell me a story. It was a dark night. The night was dark and the robbers were in a cave. One robber said to the other, "Tell us a tale." And this is the tale he told. It was a dark night. The night was dark and the robbers were in a cave. One robber said to the other, "Tell us a tale." And this is the tale he told. This rather strange story demonstrates the essence of recursion. Take a look at this image. You can see there's mirrors and each mirror contains what looks like a reflection of the previous image. So in some ways, this also demonstrates the essence of recursion in a way that the previous story did. And for a third example, we have a Turtle graphics program which is going to draw us a spiral using a recursive algorithm. And there it is. So what is it that these examples all have in common? Well, think about that for a minute before we take a deep dive into the fascinating world of recursion algorithms with the Python programming language. If you can't see the connection yet, don't worry. All will become clear as we progress.

Contents