Currently, in order to do what I'm describing, I have a code like this:
if key in dict:
dict[key].append(item)
else:
dict[key] = [item]
Is there any way I can append to list within dictionary without doing the explicit check?
Can this be done using another data structure?
What I need to do is to track all the items that have some parameter equal.