Let’s explore recursion by writing a function to generate the terms of the Fibonacci sequence. We will use a technique called “memoization” to make the function fast. We’ll first implement our own caching, but then we will use Python’s builtin memoization tool: the lru_cache decorator.
Our Python Tutorials will help you learn Python quickly and thoroughly. We start with "Hello World" and then move on to data structures (sets, lists, tuples and dictionaries). Next we'll cover classes, and give a variety of in-depth examples and applications.
Python is a clean and powerful programming language. You can use it to build websites, analyze data, write utilities, and create many other kinds of software. In this series we will teach everything you need to know to begin writing your own code in Python.