collection data types separately in some other sequence types are provided in the standard librarymost notablycollections namedtuple when iteratedall of these sequences provide their items in order strings we covered strings in the preceding in this section we will cover tuplesnamed tuplesand lists |tuples string slicing and striding tuple is an ordered sequence of zero or more object references tuples support the same slicing and striding syntax as strings this makes it easy to extract items from tuple like stringstuples are immutableso we cannot replace or delete any of their items if we want to be able to modify an ordered sequencewe simply use list instead of tupleor if we already have tuple but want to modify itwe can convert it to list using the list(conversion function and then apply the changes to the resultant list the tuple data type can be called as functiontuple()--with no arguments it returns an empty tuplewith tuple argument it returns shallow copy of the argumentand with any other argument it attempts to convert the given object to tuple it does not accept more than one argument tuples can also be created without using the tuple(function an empty tuple is created using empty parentheses()and tuple of one or more items can be created by using commas sometimes tuples must be enclosed in parentheses to avoid syntactic ambiguity for exampleto pass the tuple to functionwe would write function(( )figure shows the tuple "venus"- "green"" " and the index positions of the items inside the tuple strings are indexed in the same waybut whereas strings have character at every positiontuples have an object reference at each position [- [- [- [- [- 'venus- 'green' [ [ [ [ [ figure tuple index positions tuples provide just two methodst count( )which returns the number of times object occurs in tuple tand index( )which returns the index position of the leftmost occurrence of object in tuple --or raises valueerror exception if there is no in the tuple (these methods are also available for lists in additiontuples can be used with the operators (concatenation)(replication)and [(slice)and with in and not in to test for membership the +and *augmented assignment operators can be used even though tuples are shallow and deep copying