Python 的数据类型
2015-12-18 22:30
483 查看
列表
#coding=utf-8
students=["小明","小华","小李","小娟","小云"] print students[3] students[3]="小月" print students[3]
#元祖,元祖的内容不能修改 students=("小明","小华","小李","小娟","小云") students[1]="小月" print students[1]
#集合 a=set("abcslkdddjflk") b=set("cfm") #交集 x=a&b print x #并集 y=a|b print y #差集 z=a-b print z #去除重复元素 new=set(a) print new #字典
#coding=utf-8 k={"姓名:":"典韦","籍贯":"桂林"} print k["籍贯"] #添加字典里面的项目 k["爱好"]="音乐" print k["姓名"] print k["爱好"]
相关文章推荐
- python的数与字符串
- Python 常量与变量
- python之路-DAY8
- 最短路径算法—Dijkstra(迪杰斯特拉)算法分析与实现(Python)
- python 学习第八课 -- 异常 反射 socket
- LeetCode Longest Common Prefix
- 零基础入门学习Python(14):集合set()
- python中的正则替换字符串函数re.sub
- (转)Python爬虫学习笔记(2):Python正则表达式指南
- python os.path模块
- pythonchallenge(0-9)
- python爬豆瓣电影Top250
- Python学习笔记(一)压缩与解压缩文件
- [Python标准库]difflib——比较序列
- python : 批量下载R语言库包
- ICMP隧道之端口转发(Python)
- 也说性能测试,顺便说python的多进程+多线程、协程
- Python批量添加库搜索路径
- 创建对称矩阵(numpy)
- python开源库——h5py快速指南