主页
Python
Python 字典(Dictionary) fromkeys() 方法
demo_ref_dictionary_fromkeys
运行 ❯
×
更改方向
保存代码
更改主题
x = ('key1', 'key2', 'key3') y = 0 thisdict = dict.fromkeys(x, y) print(thisdict)
['key1': 0, 'key2': 0, 'key3': 0]