---
title: "flw_spike0001"
description: ""
slug: "spike-flow"
source: "https://flowii.agensii.com/watch/spike-flow"
duration_s: 30.0
video_format: 
video_width: 
video_height: 
video_fps: 
layer_version: 1
published_at: 
exported_at: 2026-07-16T13:18:32.184909Z
---

# flw_spike0001

## Chapters

- [0:00](https://flowii.agensii.com/watch/spike-flow?t=0) Memoization in Python

## Objects

### terminal output

Future note: [[flw_spike0001 — terminal output]]

- UID: trk_terminal01
- Category: text_block

#### Visibility intervals

- [0:00](https://flowii.agensii.com/watch/spike-flow?t=0&object=trk_terminal01)–[0:29](https://flowii.agensii.com/watch/spike-flow?t=29.9&object=trk_terminal01)

#### Extracted text

```text
$ python fibonacci.py
2880067194370816120
```

### fibonacci.py — memoized fib()

Future note: [[flw_spike0001 — fibonacci.py — memoized fib()]]

- UID: trk_codeeditor01
- Category: code

#### Visibility intervals

- [0:00](https://flowii.agensii.com/watch/spike-flow?t=0&object=trk_codeeditor01)–[0:29](https://flowii.agensii.com/watch/spike-flow?t=29.9&object=trk_codeeditor01)

#### Custom attributes

- difficulty: intro

#### Resources

- [Associated link](https://github.dev/flowii-demo/python-tutorials/blob/main/fibonacci.py#L8) — link

#### Actions

- [Open source at line 8 in GitHub.dev](https://github.dev/flowii-demo/python-tutorials/blob/main/fibonacci.py#L8) — application: GitHub.dev · handler: open_code_at_line · primary

#### Extracted text

```text
# fibonacci.py — naive vs memoized
from functools import lru_cache

@lru_cache(maxsize=None)
def fib(n: int) -> int:
    """Return the n-th Fibonacci number."""
    if n < 2:
        return n
    return fib(n - 1) + fib(n - 2)

print(fib(90))  # instant, even at n=90
```
