<html>
<head>
<meta name="generator" content="Windows Mail 17.5.9600.20315">
<style><!--
.EmailQuote {
margin-left:1pt;
padding-left:4pt;
border-left:#800000 2px solid;
}
--></style><style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst,
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle,
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style></head>
<body dir="ltr">
<div data-externalstyle="false" dir="ltr" style="font-family: 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif';font-size:12pt;"><div>Effettivamente è molto compatta ed elegante, non conoscevo la funzione map(), praticamente è una forma più compatta di yield se non ho capito male .</div><div><br></div><div>grazie della dritta</div><div><br></div><div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;"><div><font face=" 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif'" style='line-height: 15pt; letter-spacing: 0.02em; font-family: "Calibri", "Segoe UI", "Meiryo", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; font-size: 12pt;'><b>Da:</b> <a href="mailto:berdario@gmail.com" target="_parent">Dario Bertini</a><br><b>Data invio:</b> giovedì 5 dicembre 2013 00:54<br><b>A:</b> <a href="mailto:python@lists.python.it" target="_parent">Mailing List Python</a></font></div></div><div><br></div><div dir="">
<div class="PlainText">>>> tree=((),((),((),((),(),((),)))),((),()))<br>
>>> tree<br>
((), ((), ((), ((), (), ((),)))), ((), ()))<br>
>>> def height(tree):<br>
... if len(tree) == 0:<br>
... return 1<br>
... else:<br>
... return 1+max(map(height, tree))<br>
...<br>
>>> height(tree)<br>
6<br>
<br>
<br>
-- <br>
xmpp: berdario@gmail.com<br>
bitmessage: BM-2cTYXfGiSTsnx3righ6aHcJSWe4MV17jDP<br>
gpg fingerprint: 3F8D53518012716C4EEF7DF67B498306B3BF75A0 (used just<br>
for signing commits)<br>
_______________________________________________<br>
Python mailing list<br>
Python@lists.python.it<br>
<a href="http://lists.python.it/mailman/listinfo/python" target="_parent">http://lists.python.it/mailman/listinfo/python</a><br>
</div>
</div></div>
</body>
</html>