table list methods syntax description append(xappends item to the end of list count(xreturns the number of times item occurs in list extend(ml + appends all of iterable ' items to the end of list lthe operator +does the same thing index(xstartendreturns the index position of the leftmost occurrence of item in list (or in the start:end slice of )otherwiseraises valueerror exception insert(ixinserts item into list at index position int pop(returns and removes the rightmost item of list pop(ireturns and removes the item at index position int in remove(xremoves the leftmost occurrence of item from list lor raises valueerror exception if is not found reverse(reverses list in-place sortsorts list in-placethis method accepts the same key and reverse optional arguments as the built-in sorted(sorted( in the first call we provide the three arguments normally in the second call we use starred argument--what happens here is that the three-item list is unpacked by the operatorso as far as the function is concerned it has received the three arguments it is expecting we could have achieved the same thing using -tuple and in the third call we pass the first argument conventionallyand the other two arguments by unpacking two-item slice of the list functions and argument passing are covered fully in there is never any syntactic ambiguity regarding whether operator is the multiplication or the sequence unpacking operator when it appears on the left-hand side of an assignment it is the unpacking operatorand when it appears elsewhere ( in function callit is the unpacking operator when used as unary operator and the multiplication operator when used as binary operator we have already seen that we can iterate over the items in list using the syntax for item in lif we want to change the items in list the idiom to use isfor in range(len( )) [iprocess( [ ]the built-in range(function returns an iterator that provides integers with one integer argumentnthe iterator range(returnsproducing range(