Python复习
IT菜小白
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python笔记--列表和字典的基本使用
列表可以多重赋值。举个例子: list_example = [1, 2, 3] b, c, d = list_example列表的方法有:list.index(item)--返回下标;list.append(item)--添加新值至末尾;list.insert(index, item)--添加新值至index处;lis.remove(item)--删除值(只有第一次的值会被删,知道值所对应的下标...原创 2018-04-01 22:27:05 · 283 阅读 · 0 评论 -
处理CSV文件和JSON文件
处理CSV文件:直接上示例吧:import csv exampleFile = open('example.csv')# 假设csv文件已在工作目录下 exampleReader = csv.reader(exampleFile) print(list(exampleReader)) # 也可以用for循环从Reader对象中读取数据, 每一行都是一个列表。 for row in examleFi...原创 2018-04-06 16:38:35 · 1377 阅读 · 0 评论
分享