''' Purpose: Print the characters in user-supplied text, character by character, stripped and converted to lower-case ''' # get text from user reply = input( 'Enter some text: ' ) # massage user-text text = reply.strip() # remove whitespace at beginning and end of reply text = text.lower() # make every character lower case print( text ) # should a stripped down version of the user input # with all characters in lower space print() ; input( 'Enter when ready: ' ); print() # print the characters in reply one by one # We don't know how many characters are in reply n = len( text ) # want to know the size of the text, so let's use # built-in function len(), which will tell us the # number of characters in text for i in range( 0, n ): # i is going to take on one-at-a-time all of the valid # index's into text ch = text[ i ] # peek inside text and look at its character at index i print( i, ch ) # print the index and the character at that index in text