A lot of computations involve processing a collection one item at a time. For strings this means that we would like to process one character at a time. Often we start at the beginning, select each character in turn, do something to it, and continue until the end. This pattern of processing is called a traversal.
Recall that the loop variable takes on each value in the sequence of names. The body is performed once for each name. The same was true for the sequence of integers created by the range function.
The loop variable achar is automatically reassigned each character in the string βGo Spot Goβ. We will refer to this type of sequence iteration as iteration by item. Note that it is only possible to process the characters one at a time from left to right.