I want to have lists as values of a dictionary and want to ability to append to those list when there is a match in key.
I understand I can do it when the list is predefined as follows:
hashmap = {}
k = [1,2,3]
val = ['a','b','c']
for i in k:
hashmap[i]= val
for j in hashmap.keys():
print(hashmap[j])
But what if the contents of the val list is not defined. How do I declare it runtime and append to those list?