Python--集合
来源:互联网 发布:贵州省大数据公需科目 编辑:程序博客网 时间:2024/06/11 03:22
集合 数据类型
a=range(5,10)
b=range(7,12)
数据做对比,求相同的,不同的等
现在取两者相同的值,
将其变成集合,集合的一个主要功能是去重,指的是其内部的重复值
c=set(a)
d=set(b)
c&d 取交集
c | d 取并集
c ^ d 反交集,将不同元素放一起
c-d 取d中没有的
d-c
阅读全文
0 0
- python 集合
- python集合
- python 集合
- [python]集合
- Python 集合
- Python 集合
- python集合
- Python集合
- Python--集合
- Python:集合
- Python 集合
- Python集合
- python集合
- python 集合
- python 集合
- Python 集合
- Python集合
- python-集合
- NDK笔记 Linux下编译ffmpeg
- 剖析支付宝首页TableView的结构
- C/C++数据类型
- 循环冗余校验(CRC校验)
- MySQL命令
- Python--集合
- could not create local repository at(用户下没有.m2文件夹)
- Spring中Quartz调度器的使用
- [week 17][Leetcode][Binary Search] Arranging Coins
- HDU 4422 The Little Girl who Picks Mushrooms【水题】
- C#中调用存储过程并且具有返回值
- 12个不可不知的Sublime Text应用技巧和诀窍
- 关于使用Anaconda的总结(包含多环境管理)
- php单例模式