dict.fromkeys all point to same list

后端 未结 4 2014
时光说笑
时光说笑 2020-11-22 05:25

This was causing me a bit of grief...

I created a dictionary from a list

l = [\'a\',\'b\',\'c\']
d = dict.fromkeys(l, [0,0]) # initializing dictionar         


        
4条回答
提交回复
热议问题