python集合常用命令

in 包含       not  in   不包含

     len()——字符串长度       sum()——求和

     max()——找最大          min()——找最小

     a-b——a有b没有       b-a——b有a没有

     a|b——a或b中有       a&b——a和b中都有     a^b——a和b中不都有

n.add()——往集合内添加内容

n.clear()——移除集合中的所有元素

n. discard()——删除集合内指定元素,也可以n. remove()——没有时会出错

n. pop()——删除集合内随机元素