[Tutor] Decision matrix
Erik Price
eprice@ptc.com
Thu Feb 13 13:26:07 2003
Jeff Shannon wrote:
>
>
> Erik Price wrote:
>
>>
>> [1] Is a string really a list of characters, or does it just allow you
>> to treat it as one? Anyone know?
>
>
>
> Not quite -- a string is a *sequence* of characters. Lists and tuples
> are also sequences. There's similarities, but also differences. For
> instance, any sequence can be used in a for loop. However, lists are
> the only (built-in) sequence that can be sorted. It is pretty easy to
> convert between these sequences, however.
Oh, I didn't know that. Thanks for the clarification. Followup
question: which sequence is used for strings? Or does it not matter.
Erik