this question has answer here:
- make dictionary duplicate keys in python 4 answers
python dictionary removes duplicates default dont want remove duplicates
program
s = {"a":"s","a":"b","b":"d"} print s
output
{'a': 'b', 'b': 'd'}
output expected
{'a':'s','a':'b','b':'d'}
you should consider using other structure. dictionary key-value each key there 1 value. try using either list of tuples or each key in dict store list of values.
Comments
Post a Comment