I can't find an answer. I read a dictionary from file, it has a string value for a key. Then I check if a new value is already in the dictionary, if it isn't then I want to append it to the previous string and to get a list of values for a given key.
For example if I have a dictionary
dict = {"vehicles": "car", "animals": "cat"}
and the following condition is true
if "dog" not in dict["animals"]:
I'd like to get the output
dict = {"vehicles": "car", "animals": ["cat", "dog"] }