摘要: Python中的文件打开模式 pycharm新建文本文件zhuxian,内容为一首歌的歌词 阅读全文
posted @ 2017-03-29 20:00 penghx 阅读(592) 评论(0) 推荐(0) 编辑
摘要: list_1 = [1,2,2,3,4,5,6,7,9,8] list_1 = set(list_1 ) #set去重复 print(list_1,type(list_1 )) #结果:{1, 2, 3, 4, 5, 6, 7, 8, 9} list_2 = set([0,2,22,66,33,6,8,22]) #直接set去重复 #list_2 = set(li... 阅读全文
posted @ 2017-03-29 19:50 penghx 阅读(171) 评论(0) 推荐(0) 编辑
摘要: info = { 'p1101':["peng","hao"], 'p1102':"wu", 'p1103':"tan", 'p1104':"zhou", } print(info) print(info['p1101']) #查找,无则报错KeyError info["p1101"] = "彭" #修改 info["p1105"] = "ming 阅读全文
posted @ 2017-03-29 13:58 penghx 阅读(147) 评论(0) 推荐(0) 编辑