structured typesmutabilityand higher-order functions considerfor example the function def findextremedivisors( )"""assumes that and are positive ints returns tuple containing the smallest common divisor and the largest common divisor of and ""divisors (#the empty tuple minvalmaxval nonenone for in range( min( )if % = and % = if minval =none or minvalminval if maxval =none or maxvalmaxval return (minvalmaxvalthe multiple assignment statement mindivisormaxdivisor findextremedivisors( will bind mindivisor to and maxdivisor to lists and mutability like tuplea list is an ordered sequence of valueswhere each value is identified by an index the syntax for expressing literals of type list is similar to that used for tuplesthe difference is that we use square brackets rather than parentheses the empty list is written as []and singleton lists are written without that (oh so easy to forgetcomma before the closing bracket sofor examplethe codel [' did it all' 'love'for in range(len( ))print [iproduces the outputi did it all love occasionallythe fact that square brackets are used for literals of type listindexing into listsand slicing lists can lead to some visual confusion for examplethe expression [ , , , ][ : ][ ]which evaluates to uses the square brackets in three different ways this is rarely problem in practicebecause most of the time lists are built incrementally rather than written as literals lists differ from tuples in one hugely important waylists are mutable in contrasttuples and strings are immutable there are many operators that can be used to create objects of these immutable typesand variables can be bound to objects of these types but objects of immutable types cannot be modified on the other handobjects of type list can be modified after they are created the distinction between mutating an object and assigning an object to variable mayat firstappear subtle howeverif you keep repeating the mantra"in