List Methods

 0    12 fiche    sir
baixar mp3 Imprimir jogar verifique-se
 
questão resposta
Adds an item to the end of the list.
começar a aprender
. append()
Adds an item at the specified index.
começar a aprender
. insert()
Removes the specified item.
começar a aprender
. remove()
Removes the specified index, (or the last item if index is not specified).
começar a aprender
. pop(i'index)
Keyword which, removes the specified index, whole list, variable or function.
começar a aprender
del
Method which empties the list.
começar a aprender
. clear()
You can make a copy of a list with the this method.
começar a aprender
list2 = list1. copy()
Usethis method to add list2 at the end of list1.
começar a aprender
list1. extend(list2)
Returns the index of the first element with the specified value
começar a aprender
. index(value)
Reverses the order of the list.
começar a aprender
. reverse()
Sorts the list.
começar a aprender
list. sort(reverse=True|False, key=myFunc)
Returns the number of times a specified value occurs in a list.
começar a aprender
. count()

Você deve entrar para postar um comentário.