
List
screaming
这个作者很懒,什么都没留下…
展开
-
del Statement
5.2 The del statementThere 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 · 321 阅读 · 0 评论 -
Python list index method
Python List index() MethodAdvertisements Previous PageNext Page DescriptionThe method index() returns the lowest index in list that obj appears.SyntaxFollowi转载 2016-05-14 10:31:19 · 710 阅读 · 0 评论 -
Python list to string
By using ''.joinlist1 = ['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 · 666 阅读 · 0 评论 -
Python list dict iteration
Python tricks(3) -- list和dict的遍历和方法2014-01-23 23:11 by 会被淹死的鱼, 1631 阅读, 0 评论, 收藏, 编辑每个人在使用python的过程中都会遍历list和dict.List遍历最常用最简单的遍历list的方法12345a =转载 2016-05-06 15:16:11 · 829 阅读 · 0 评论 -
Python Looping enumerate, reversed, sorted, iteritems, zip
Looping TechniquesWhen 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 · 442 阅读 · 0 评论