Dictionary Changed Size During Iteration
How would I remedy the following error? for item in data: if data[item] is None: del data[item] RuntimeError: dictionary changed size during iteration It doesn't actu
Solution 1:
You have to move changing dictionary to another vairable:
changing_data = datafor item indata:
if changing_data[item] is None:
del changing_data[item]
data = changing_data
Post a Comment for "Dictionary Changed Size During Iteration"