给一个字典为空的赋值

1 def deDict(dict_o,value=None):
2     
3     if type(dict_o) is dict and "william" in dict_o.keys():
4         if dict_o['william']=value
5             dict_0=None
6         print(dict_o)
7 deDict({"dict_o":"value","william":"None"},"who")

如果字典william为空,就给他赋值

posted @ 2019-12-05 10:32  九州天空城  阅读(1168)  评论(0编辑  收藏  举报