[Tutor] Iterating two one dimensional lists to create a multidemsional array

W W srilyk at gmail.com
Sat Oct 11 13:13:34 CEST 2008


On Fri, Oct 10, 2008 at 10:59 PM, Kent Johnson <kent37 at tds.net> wrote:
> On Fri, Oct 10, 2008 at 10:45 PM, S Potter <f8lcoder at hotmail.com> wrote:
><snip>
>> poem ={ ['roses','are red'],
>>               ['violets','are blue'],
>>               ['sugar','are sweet']
>>               ['so','are you'] }

Another thing to note - the way you have it written here, { } is the
dictionary notation, and dictionaries are unordered, and require
immutable keys (lists are mutable).

HTH,
Wayne


More information about the Tutor mailing list