<br><font size=2 face="sans-serif">Nazdar,</font>
<br>
<br><font size=2 face="sans-serif">Nepouzivas slovnik, ale zoznam (list),
presnejsie zoznam zoznamov.</font>
<br><font size=2 face="sans-serif">Vytriedilo ti to dobre, problem je v
tom, ze v kazdom podzozname su prvky s indexom 2 retazce a teda sa triedi
lexikograficky:</font>
<br><font size=2 face="Courier New">'199'&lt; '21'&lt;'90'</font>
<br><font size=2 face="sans-serif">Ak chces triedit ciselne, t.j. </font>
<br><font size=2 face="Courier New">21&lt;90&lt;199</font>
<br><font size=2 face="sans-serif">tak musis pouzit cisla t.j. nie '21'
ale bez apostrofov 21, takze takto:</font>
<br>
<br><font size=2 face="Courier New"><b>x = [['0', '3', 21, '&quot;aaaaa&quot;'],
['1', '2', 90, '&quot;ccccc&quot;'],['2','15', 199, '&quot;Bbbbb&quot;']]</b></font>
<br><font size=2 face="Courier New"><b>x.sort(key=porovnej)</b></font>
<br>
<br><font size=2 face="sans-serif">potom je vysledok:</font>
<br>
<br><font size=2 face="Courier New"><b>[['0', '3', 21, '&quot;aaaaa&quot;'],
['1', '2', 90, '&quot;ccccc&quot;'], ['2', '15', 199, '&quot;Bbbbb&quot;']]
&nbsp;</b></font><font size=2 face="sans-serif"><b><br>
</b></font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>smoke &lt;konfera@rokyta.cz&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: tutor-bounces@py.cz</font>
<p><font size=1 face="sans-serif">16.10.2006 00:18</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
Konference Tutor portalu PyCZ &lt;tutor@py.cz&gt;</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">Konference Tutor portalu
PyCZ &lt;tutor@py.cz&gt;</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">[Tutor PyCZ] Problemy s razenim
- sort()</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Zdravim,<br>
<br>
chtel bych se zeptat jak vyresit tento problem.<br>
<br>
..pouziju funkci kterou jsem okoukla od geona ;)<br>
<br>
def porovnej(sz1):<br>
 &nbsp; &nbsp;return sz1[2]<br>
<br>
#mam slovnik typu...<br>
x = [['0', '3', '21', '&quot;aaaaa&quot;'], ['1', '2', '90', '&quot;ccccc&quot;'],
['2',<br>
'15', '199', '&quot;Bbbbb&quot;']]<br>
<br>
x.sort(key=porovnej)<br>
<br>
#A vyjde mi toto:<br>
[['2', '15', '199', '&quot;Bbbbb&quot;'], ['0', '3', '21', '&quot;aaaaa&quot;'],
['1', '2',<br>
'90', '&quot;ccccc&quot;']]<br>
<br>
#Coz je spatne - vysledek ktery potrebuji musi byt:<br>
[['0', '3', '21', '&quot;aaaaa&quot;']['1', '2', '90', '&quot;ccccc&quot;']['2',
'15',<br>
'199', '&quot;Bbbbb&quot;']<br>
<br>
#Take spatne razeni je i u stringu (x[3]) - kde to musi byt razeno podle<br>
abecedy nehlede na male nebo velke pismena<br>
<br>
Resim to uz nekolik dni a vzhledem ktomu, ze uz v tom doslova plavu -<br>
zkousit najit radu zde - dekuji.<br>
<br>
-- <br>
 &nbsp; &nbsp; &nbsp; _ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;_<br>
 ___ _| |_ ____ __ &nbsp;___| |_____ ___<br>
|___|_ &nbsp; _(_-&lt; ' &nbsp;\/ _ \ / / -_)___|<br>
 &nbsp; &nbsp; &nbsp;|_| /__/_|_|_\___/_\_\___|<br>
 &nbsp; &nbsp; &nbsp; JID: smoke@njs.netlab.cz<br>
_______________________________________________<br>
Tutor mailing list<br>
Tutor@py.cz<br>
http://www.py.cz/mailman/listinfo/tutor<br>
</tt></font>
<br><font size=2 face="sans-serif"><br>
Mgr. Ing. Roman MIKLÓ© <br>
Prvá stavebná sporiteµňa a.s. <br>
Bajkalská 30, P. O. Box 48 <br>
829 48 &nbsp;Bratislava 25 <br>
Tel.: +421/ 2 / 582 31 174 <br>
Fax: +421/ 2 / 582 31 109 <br>
</font>