Comment

Comment by earthboundkid

Python has too many ways to do it:

    >>> state2name2visited = {}
    >>> state2name2visited.setdefault("PA", {}).setdefault("Joe", []).append("Pittsburgh")
    >>> state2name2visited
    {'PA': {'Joe': ['Pittsburgh']}}

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton