一直以为{} 字典专用,其实不是,看案例说话:
s = {1,2}
s.add(3)
type(s)
输出:set
s = {"a":1,"b":2}
type(s)
输出 :dict
s = {}
type(s)
输出:dict类型
一直以为{} 字典专用,其实不是,看案例说话:
s = {1,2}
s.add(3)
type(s)
输出:set
s = {"a":1,"b":2}
type(s)
输出 :dict
s = {}
type(s)
输出:dict类型