python的setdefault Python 字典 setdefault() 方法和get()方法类似, 如果键不已经存在于字典中,将会添加键并将值设为默认值。 dict.setdefault(key, default=None)