<div>Sorry to be so confusing. Just realized a dumb mistake I made. It doesn't need to be resorted alphabetically and numerically. I need one list alphabetical and one numerical.</div> <div> </div> <div> </div> <div> (Alphabetical) List 1, [('Fred', 20), ('Joe', 90), ('Kent', 50), ('Sara', 80)]<BR> </div> <div>(Numerical) List 2, [('Fred', 20), ('Kent', 50), ('Sara', 80) ('Joe', 90)]</div> <div> </div> <div> </div> <div>It looks like these are appended together, but to re-sort, how do I (not sure if this is a word) "unappend" them?</div> <div> </div> <div>Thanks,<BR>Sara</div> <div><BR><BR><B><I>Alan Gauld <alan.gauld@btinternet.com></I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"> <div>"Sara Johnson" <SARLIZ73@YAHOO.COM>wrote<BR><BR>>>Use append() to add more data, then sort again to get it in
order:<BR>>>>>In [6]: data.append(('Joe', 90))<BR>>>>>In [7]: data.sort()<BR>>>>>In [8]: data<BR>>>>>Out[8]: [('Fred', 20), ('Joe', 90), ('Kent', 50), ('Sara', 80)]<BR>><BR>> What happens if I need to sort alphabetical and numerically?<BR><BR>You can supply your own comparison function to the sort routine.<BR>You can also just specify the key to sort by for simple cases.<BR><BR>> I'm taking the original list and the original values<BR>> i.e., ('Fred', 20), ('Joe', 90), ('Kent', 80)... and switching it <BR>> so that it reads in both ways...<BR>> List 1, [('Fred', 20), ('Joe', 90), ('Kent', 50), ('Sara', 80)]<BR>> List 2, ('Fred', 20), ('Joe', 50), ('Kent', 80), ('Sara', 90)]<BR><BR>But you lost me here. You seem to be switching the values<BR>in the tuples around and its not clear to me by what criteria.</div> <div> </div></BLOCKQUOTE><p> 
<hr size=1>Looking for a deal? <a href="http://us.rd.yahoo.com/evt=47094/*http://farechase.yahoo.com/;_ylc=X3oDMTFicDJoNDllBF9TAzk3NDA3NTg5BHBvcwMxMwRzZWMDZ3JvdXBzBHNsawNlbWFpbC1uY20-">Find great prices on flights and hotels</a> with Yahoo! FareChase.