Filtering Dictionary In Python 3
“RuntimeError: Dictionary changed size during iteration”, Python slaps you in your face when you try to add/remove entries in dict object during iteration.
In this post, I will walk us through how we can filter a dict collection. First, let us try to...
melvinkoh.me
Seth Livingston
Technical Lead for CultureMap, InnovationMap, SportsMap, & AutomotiveMap. Python, Django, Elm, & JavaScript.
Try the same operation using a dict comprehension; I think you'll like the result. :)