<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=Windows-1252>
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY id=MailContainerBody 
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" 
bgColor=#ffffff leftMargin=0 topMargin=0 CanvasTabStop="true" 
name="Compose message area">
<DIV><FONT face=Garamond color=#000080>Thanks Steve.&nbsp; How do you sort on 
the second element of each list to get:</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT face=Garamond color=#000080>a' = [[42, 'fish'],</FONT></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT face=Garamond 
color=#000080>[1, 'hello']</FONT></DIV>
<DIV><FONT face=Garamond 
color=#000080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2, 
'world']</FONT></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT face=Garamond 
color=#000080>]</FONT></DIV>
<DIV><FONT face=Garamond color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT face=Garamond color=#000080></FONT>&nbsp;</DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><FONT face=Garamond color=#000080 size=3></FONT><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A 
title="mailto:steve@alchemy.com&#10;CTRL + Click to follow link" 
href="mailto:steve@alchemy.com">Steve Willoughby</A> </DIV>
<DIV><B>Sent:</B> Monday, September 22, 2008 8:16 PM</DIV>
<DIV><B>To:</B> <A 
title="mailto:dineshbvadhia@hotmail.com&#10;CTRL + Click to follow link" 
href="mailto:dineshbvadhia@hotmail.com">Dinesh B Vadhia</A> </DIV>
<DIV><B>Cc:</B> <A title=tutor@python.org 
href="mailto:tutor@python.org">tutor@python.org</A> </DIV>
<DIV><B>Subject:</B> Re: [Tutor] array of different datatypes</DIV></DIV></DIV>
<DIV><BR></DIV>Dinesh B Vadhia wrote:<BR>&gt; I have looked (honestly!) and 
cannot see an array structure to allow different datatypes per column.&nbsp; I 
need a 2 column array with column 1 = an integer and column 2 = chars, and after 
populating the array, sort on column 2 with column 1 sorted relatively.&nbsp; 
<BR><BR><BR>If by "array" you mean a regular Python list, the data type 
of<BR>every single element may be different.&nbsp; So it's just how 
lists<BR>always work.<BR><BR>a = [[1, 
'hello'],<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [2, 
'world'],<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [42, 
'fish'],<BR>&nbsp;&nbsp;&nbsp;&nbsp; ]<BR><BR>&gt; Thanks!<BR>&gt; <BR>&gt; 
Dinesh<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; 
------------------------------------------------------------------------<BR>&gt; 
<BR>&gt; _______________________________________________<BR>&gt; Tutor 
maillist&nbsp; -&nbsp; <A 
href="mailto:Tutor@python.org">Tutor@python.org</A><BR>&gt; <A 
href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</A><BR><BR></BODY></HTML>