@jcoglan a first attempt: dict['a'] = dict.get('a',0). I feel there's a slightly more obvious way though
@christianp @jcoglan in fact, two lines lower in the docs: dict.setdefault('foo',0). docs.python.org/library/stdtyp…
@jcoglan a first attempt: dict['a'] = dict.get('a',0). I feel there's a slightly more obvious way though
@christianp @jcoglan in fact, two lines lower in the docs: dict.setdefault('foo',0). docs.python.org/library/stdtyp…