[Tutor] how best to remove an item from a dict

Alex Kleider akleider at sonic.net
Mon Jan 6 19:55:43 EST 2020


Which is best:

  >>>   _ = d.pop(key)
or
  >>>    del d[key]
??

  >>> import this
...
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
...

Cheers,
-- 
Alex Kleider
(sent from my current gizmo)



More information about the Tutor mailing list