employ slicing to make this last case workabc string[ ]string[ ]string[ :abc (' '' ''am'index and slice abc list(string[: ][string[ :]abc (' '' ''am'slice and concatenate ab string[: string[ :abc (' '' ''am'samebut simpler (ab) string[: ]string[ :abc (' '' ''am'nested sequences as the last example in this interaction demonstrateswe can even assign nested sequencesand python unpacks their parts according to their shapeas expected in this casewe are assigning tuple of two itemswhere the first item is nested sequence ( string)exactly as though we had coded it this waypaired by shape and position ((ab) ('sp''am'abc (' '' ''am'python pairs the first string on the right ('sp'with the first tuple on the left ((ab)and assigns one character at timebefore assigning the entire second string ('am'to the variable all at once in this eventthe sequence-nesting shape of the object on the left must match that of the object on the right nested sequence assignment like this is somewhat rare to seebut it can be convenient for picking out the parts of data structures with known shapes for examplewe'll see in that this technique also works in for loopsbecause loop items are assigned to the target given in the loop headerfor (abcin [( )( )]simple tuple assignment for ((ab)cin [(( ) )(( ) )]nested tuple assignment in note in we'll also see that this nested tuple (reallysequenceunpacking assignment form works for function argument lists in python (though not in )because function arguments are passed by assignment as welldef (((ab) )) ((( ) )for arguments too in python xbut not sequence-unpacking assignments also give rise to another common coding idiom in python--assigning an integer series to set of variablesassignment statements