loading...

Discussion on: Pythonic way to aggregate or group elements in a list using dict.get and dict.setdefault

Collapse
waylonwalker profile image
Waylon Walker

Diddo the swap from

for i in range(len(items)):
   ...

to

for item in items:
   ...
Collapse
mojemoron profile image
Micheal Ojemoron Author

you are absolutely right, I have updated the code. Thanks