List
screaming
这个作者很懒,什么都没留下…
展开
-
del Statement
5.2 The del statement There is a way to remove an item from a list given its index instead of its value: the del statement. This differs from the pop() method which returns a value. The del stateme转载 2016-05-03 13:52:19 · 313 阅读 · 0 评论 -
Python list index method
Python List index() Method Advertisements Previous Page Next Page Description The method index() returns the lowest index in list that obj appears. Syntax Followi转载 2016-05-14 10:31:19 · 695 阅读 · 0 评论 -
Python list to string
By using ''.join list1 = ['1', '2', '3'] str1 = ''.join(list1) Or if the list is of integers, convert the elements before joining them. list1 = [1, 2, 3] str1 = ''.join(str(e) for e in list1)转载 2016-05-05 17:17:38 · 651 阅读 · 0 评论 -
Python list dict iteration
Python tricks(3) -- list和dict的遍历和方法 2014-01-23 23:11 by 会被淹死的鱼, 1631 阅读, 0 评论, 收藏, 编辑 每个人在使用python的过程中都会遍历list和dict. List遍历 最常用最简单的遍历list的方法 1 2 3 4 5 a =转载 2016-05-06 15:16:11 · 819 阅读 · 0 评论 -
Python Looping enumerate, reversed, sorted, iteritems, zip
Looping Techniques When looping through a sequence, the position index and corresponding value can be retrieved at the same time using the enumerate() function. >>> >>> for i, v in enumerate(['转载 2016-06-03 15:06:51 · 435 阅读 · 0 评论