Python dictionaries don't support duplicate keys. One way around is to store lists or sets inside the dictionary.
One easy way to achieve this is by using
from collections import defaultdict data_dict = defaultdict(list)
All you have to do is replace
data_dict[regNumber] = details
and you'll get a dictionary of lists.
~ Answered on 2012-05-19 11:41:15