Programming

Python Data Structure Explorer — Lists, Dicts, Sets

Explore Python's built-in data structures — list, tuple, set, dict and collections.deque — by running real operations on them. See every result and error, how the structure changes, and the time complexity of each operation, then copy the session as a Python script.
Real Python 3.11 in your browserNothing is uploaded

Structure

OrderedMutableAllows duplicatesIndexed by position
data =

Press Create to build the structure with Python (the first time loads the Python runtime, about 10 MB).

Operations

O(1) Amortised constant: the list occasionally grows its storage.

How to use this tool

  1. 1Choose a structure and its starting value, then press Create.
  2. 2Click an operation (or type any Python statement using data) and press Run.
  3. 3Watch the structure update and read the result and time complexity.
  4. 4Copy the history as a Python script to keep it.

Frequently asked questions

They are the average-case costs documented for CPython (for example list.append is amortised O(1), list.insert(0, x) is O(n), set membership is O(1)).

Yes. Any Python statement or expression that uses the variable data works, and errors such as KeyError or IndexError are shown exactly as Python reports them.

Sets have no positions. The tool shows the order Python happens to iterate in, which depends on the hash values.

No. The tool runs real Python 3.11 (Pyodide, Python compiled to WebAssembly) inside your browser. The first run downloads the runtime (about 10 MB) once per visit; your code never leaves your device.