human
Python dict how to create key or append an element to key?
assistant
Here is some code to create a key `key` if it does not exist in dict `dic` and append element `value` to value.

dic.setdefault(key, []).append(value)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.