Python学习笔记之集合set

    xiaoxiao2021-12-03  16

    集合————唯一、无序

    创建方法

    set(列表、字符串、元组)s={1,2,3,4,5} 访问集合中的值 for循环读取集合中的值in或者not in看某个值在不在集合中 add方法向集合添加某个值  s.add(7) frozenset方法 不可变集合num=frozenset([1,2,3,4,5,6])

    转载请注明原文地址: https://ju.6miu.com/read-679947.html

    最新回复(0)