【python--字典】 字典的有效性

#字典 的有效性   {key:value}    key ---hashable  可哈希的
# 不可变  str  int  tuple  bool 合法运用到字典 key
#  可变   list  dict  set   不合法运用到字典 key
#  hashable  不可变
dic = {'n':1}
dic = {1:2}
dic = {(1,2):3}
#  可变d   不成立的
dic = {[1,2],2}
dic = {{'m':1},2}
dic = {{1},2}
原文地址:https://www.cnblogs.com/lxcai213/p/13306026.html