Thursday 9 April 2020

Python dict how to create key or append an element to key?

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

from : https://stackoverflow.com/questions/12905999/python-dict-how-to-create-key-or-append-an-element-to-key/12906014

No comments:

Post a Comment