This is cool! Would easily replace the slightly tricky to grok code I came across to make a binary trie last week:<p><pre><code> # in for loop:
node = trie
for char in number:
node = node.setdefault(char, {})
</code></pre>
(from here: <a href="https://www.hackerrank.com/challenges/maximum-xor/forum" rel="nofollow">https://www.hackerrank.com/challenges/maximum-xor/forum</a>)