Skip to content

Instantly share code, notes, and snippets.

@axce1
axce1 / .gitignore
Last active August 29, 2015 14:20 — forked from abulte/.gitignore
We couldn’t find that file to show.
@axce1
axce1 / tree.md
Created March 11, 2014 07:28 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!