← 返回列表

Python3 字典 Fromkeys

Python3 字典 Fromkeys #!/usr/bin/python3 seq = ('name', 'age', 'sex') dict = dict.fromkeys(seq) print ("New Dictionary : %s" % str(dict)) dict = dict.fromkeys(seq, 10) print ("New Dictionary : %s" % str(dict))

Python3 字典 Fromkeys

#!/usr/bin/python3

seq = ('name', 'age', 'sex')

dict = dict.fromkeys(seq)
print ("New Dictionary : %s" %  str(dict))

dict = dict.fromkeys(seq, 10)
print ("New Dictionary : %s" %  str(dict))

打开资源 ↗

交流与评论