摘要: 1.del message[0] 知道位置不知道值 2.message.remove('a') 知道值不知道位置 3.message.sort()--正向永久排序 4.message.sort(reverse=true)--反向永久排序 5.倒着打印列表: message.reverse() pri 阅读全文
posted @ 2020-12-29 22:12 tigergaonotes 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 转:https://m.sogou.com/web/id=4c468b90-3f64-418c-acf8-990b5fe2a757/keyword=python%20os%E6%A8%A1%E5%9D%97%E8%AF%BB%E5%8F%96%E8%AE%B0%E4%BA%8B%E6%9C%AC%E 阅读全文
posted @ 2020-12-29 21:56 tigergaonotes 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 用list类的sort方法 l1 = ['b','c','d','b','c','a','a'] l2 = list(set(l1)) l2.sort(key=l1.index) print l2 阅读全文
posted @ 2020-12-29 18:20 tigergaonotes 阅读(65) 评论(0) 推荐(0) 编辑