List Methods

 0    12 词汇卡    sir
下载mp3 打印 检查自己
 
问题 答案
Adds an item to the end of the list.
开始学习
. append()
Adds an item at the specified index.
开始学习
. insert()
Removes the specified item.
开始学习
. remove()
Removes the specified index, (or the last item if index is not specified).
开始学习
. pop(i'index)
Keyword which, removes the specified index, whole list, variable or function.
开始学习
del
Method which empties the list.
开始学习
. clear()
You can make a copy of a list with the this method.
开始学习
list2 = list1. copy()
Usethis method to add list2 at the end of list1.
开始学习
list1. extend(list2)
Returns the index of the first element with the specified value
开始学习
. index(value)
Reverses the order of the list.
开始学习
. reverse()
Sorts the list.
开始学习
list. sort(reverse=True|False, key=myFunc)
Returns the number of times a specified value occurs in a list.
开始学习
. count()

您必须登录才能发表评论。