Why does my command add the new value "test" to every list in my dictionary and not only to the one corresponding to key "key1"?
In:
# Create list of entries
list_f = ["key1", "key2"]
# Create dictionary out of list
dic_f = dict.fromkeys(list_f, [])
# Only append "test" as value to the key "key1"
dic_f["key1"].append("test")
dic_f
Out:
{'key1': ['test'],
'key2': ['test']}
Desired output:
{'key1': ['test'],
'key2': []}