3 ms·
Alternatively `bar[baz] = bar.get(baz, 0) + 1` One line and no error checking. But the OP was probably just illustrating a basic example where you might have
by bocklund 8y ago
Alternatively
`bar[baz] = bar.get(baz, 0) + 1`
One line and no error checking.
But the OP was probably just illustrating a basic example where you might have some more intense logic