tuple is one-dimensionalfixed-lengthimmutable sequence of python objects the easiest way to create one is with comma-separated sequence of valuesin [ ]tup in [ ]tup out[ ]( when defining tuples in more complicated expressionsit' often necessary to enclose the values in parenthesesas in this example of creating tuple of tuplesin [ ]nested_tup ( )( in [ ]nested_tup out[ ](( )( )any sequence or iterator can be converted to tuple by invoking tuplein [ ]tuple([ ]out[ ]( in [ ]tup tuple('string'in [ ]tup out[ ](' '' '' '' '' '' 'elements can be accessed with square brackets [as with most other sequence types like cc++javaand many other languagessequences are -indexed in pythonin [ ]tup[ out[ ]'swhile the objects stored in tuple may be mutable themselvesonce created it' not possible to modify which object is stored in each slotin [ ]tup tuple(['foo'[ ]true]in [ ]tup[ false typeerror traceback (most recent call lastin (---- tup[ false typeerror'tupleobject does not support item assignment however in [ ]tup[ append( in [ ]tup out[ ]('foo'[ ]truetuples can be concatenated using the operator to produce longer tuplesin [ ]( none'foo'( ('bar',out[ ]( none'foo' 'bar' appendixpython language essentials www it-ebooks info