index variables all the concrete examples in the last two sections used literal numbers for the indices that is fine for learning the ideabut in practicevariables or expressions are almost always used for indices as usual the variable or expression is evaluated before being used try in idle and see that the example program index py makes senses 'wordprint('the full string is'sn len(sfor in range( )print(print(' ='iprint('the letter at index :' [ ]print('the part before index (if any):' [: ]print('the part before index + :' [: + ]we will use index variables in more practical situations as we explain more operations with strings split syntax options for the split method with string ss split( split(septhe first version splits at any sequence of whitespace (blanksnewlinestabsand returns the remaining parts of as list if string sep is specifiedit is the separator that gets removed from between the parts of the list for exampleread and followtale 'this is the best of times tale split(['this''is''the''best''of''times ' 'mississippis split(' '[' ''ss''ss''pp''' split(no white space ['mississippi'predict and test each line in the shellline 'gotear some strings apart!seq line split(seq line split(':'line split('ar'lines 'this includes\\nsome new\\nlines lines split(join join is roughly the reverse of split it joins together sequence of strings the syntax is rather different the separator sep comes firstsince it has the right type ( stringsyntax for the join methodsep join(sequence objects and methods