[Tutor] Fwd: iterating

Cecilia Alm ebbaalm at uiuc.edu
Mon Apr 30 17:46:38 CEST 2007


2007/4/30, Kent Johnson <kent37 at tds.net>:
. Also if you are adding or deleting from the dict
> during the iteration then dict.keys() is safer because the list of keys
> is created before the add and delete.

Thanks for the response; by adding and deleting, I assume you refer to
adding or deleting keys (rather than changing the value associated
with the key).



--
E. Cecilia Alm
Graduate student, Dept. of Linguistics, UIUC
Office: 2013 Beckman Institute


-- 
E. Cecilia Alm
Graduate student, Dept. of Linguistics, UIUC
Office: 2013 Beckman Institute


More information about the Tutor mailing list