Hello

Trying to pop some key from a dict while is iterating over it will cause an 
exception.
How I can remove items when the search result is true.

Example:

while len(dict):
   for key in dict.keys():
      if dict[key] is not my_result:
         dict.pop(key)
    else:
       condition_to_break
print('Dictionary is over')

this is my mistake, but where to fix?
-- 
goto /dev/null
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to