Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Alternative solution:

sage: D={1:{2:3,4:2},2:{}}
sage: D[1].update({5:'smile'})
sage: D
{1: {2: 3, 4: 2, 5: 'smile'}, 2: {}}

Possibly more readable...