Saturday, March 24, 2018

Built-in List Functions & Methods


Built-in List Functions & Methods

Python includes the following list functions-
S.no
Function
Description
1
cmp(list1,list2)
No longer available in Python 3.
2
Gives the total length of the list.
3
Returns item from the list with max value.
4
Returns item from the list with min value.
5
Converts a tuple into list.

Python includes the following list methods-
6
Appends object obj to list
7
Returns count of how many times obj occurs in list
8
Appends the contents of seq to list
9
Returns the lowest index in list that obj appears
10
Inserts object obj into list at offset index
11
Removes and returns last object or obj from list
12
Removes object obj from list
13
Reverses objects of list in place
14
Sorts objects of list,use compare func if given.






<<<< Indexing, Slicing                     Index                len( ) Method >>>