DEV Community

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

Collapse
 
waylonwalker profile image
Waylon Walker • Edited

Diddo the swap from

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

to

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

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