Delete items in nested dictionary based on value.

bearophileHUGS at bearophileHUGS at
Thu Sep 14 02:10:00 CEST 2006

> Can you delete values from a dictionary whilst iterating over its items ?

Try the code, it works. I am not iterating on the dict, I am not using
dict.iteritems(), that produces a lazy iterable, I am using
dict.items() that produces a list of (key,value) pairs. And I am not
removing elements from that list :-)


More information about the Python-list mailing list