摘要: Python中排序常用到的sort 、sorted和argsort函数 Python中排序常用到的sort 、sorted和argsort函数 [摘要:Python中sort 战 sorted函数 一 、先容 sort函数是list列表中的函数,而 sorted能够对list或iterator举行排 阅读全文
posted @ 2016-04-16 16:37 和尚爱吃肉 阅读(3029) 评论(0) 推荐(0)
摘要: enumerate 函数用于遍历序列中的元素以及它们的下标: >>> for i,j in enumerate(('a','b','c')): print i,j 0 a 1 b 2 c >>> for i,j in enumerate([1,2,3]): print i,j 0 1 1 2 2 3 阅读全文
posted @ 2016-04-16 16:27 和尚爱吃肉 阅读(746) 评论(0) 推荐(0)