''' Purpose: continue string manipulation introduction ''' print() a = 'hatstall' b = 'a b' c = 'a\tb' d = 'aren\'t' e = 'a\nb' # Special characters are a "\something" and the backslash is not # it's own character - it's a single unit. # e[0] = 'a' e[1]='\n' e[2] = 'b' # We would wanna know indexes because we might ask you # for the 2nd character or for the last character or a similar problem # like that (for this class) :) # We wanna know where things are in a sequence! # IMPORTANT: A string is a sequence of characters!! (pls write this down) print( '### print strings' ) print( "a = ", a ) print( "b = ", b ) print( "c = ", c ) print( "d = ", d ) print( "e = ", e ) print() print( '### string lengths' ) na = len( a ) nb = len( b ) nc = len( c ) nd = len( d ) ne = len( e ) print( 'len( a ) =', na ) print( 'len( b ) =', nb ) print( 'len( c ) =', nc ) print( 'len( d ) =', nd ) print( 'len( e ) =', ne )