I want to add more values to specific key for example,
consider my dictionary is FinalData = {}
and it contains key value pair as: {'12345,70':xyz,'12345,71':pqr}
and now I want to add value ('abc') for same key '12345,70'so that
my final dictionary becomes {'12345,70':xyz,abc,'12345,71':pqr}
I tried to append second value by FinalData[key].append(value)
but it gives me
error: AttributeError: 'str' object has no attribute 'append'
So is their any way to resolve this, I'm new to python please help.
See Question&Answers more detail:os