<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.StileMessaggioDiPostaElettronica18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=IT link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal style='margin-left:35.4pt'><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Da:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Python <python-bounces@lists.python.it> <b>Per conto di </b>Giorgio Zoppi<br><br></span><o:p></o:p></p><div><div><div><p class=MsoNormal style='margin-left:35.4pt'>premetto che non sono uno specialista in Python , quindi mi sono uscite un paio di linee<o:p></o:p></p></div><div><div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'>test = [['Settembre 2021'], <o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'>['01 Merc', '07:58', '12:36', 'milano', 'torino', ' ', '13:57', '17:33', 'roma', 'napoli'], <o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'>['02 Giov', '07:32', '12:55', 'Torino', 'palermo', ' ', '14:13', '18:43', 'como', 'genova'], <o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'>['04 Saba'], ['05 Dome'],<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'>['06 Lune', '07:41', '12:57', 'genova', 'livorno', ' ', '13:50', '19:08', 'siracusa', 'messina'], <o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'>['22 Merc', 'Modifica', ' ', '05:09', '12:09', 'Torino', 'Torino'],<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'>['29 Merc', 'Modifica']]<o:p></o:p></span></p></div><p class=MsoNormal style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'><o:p> </o:p></span></p><div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'>has_modifica = lambda x: 'Modifica' in x<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'>v = [ x[0:2] if has_modifica(x) else x for x in test]<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:black'>print(v)<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#FFFFFE'><span style='font-size:10.5pt;font-family:"Courier New";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='line-height:14.25pt;background:#FFFFFE'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>[['Settembre 2021'], <o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>['01 Merc', '07:58', '12:36', 'milano', 'torino', ' ', '13:57', '17:33', 'roma', 'napoli'], <o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>['02 Giov', '07:32', '12:55', 'Torino', 'palermo', ' ', '14:13', '18:43', 'como', 'genova'], <o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>['04 Saba'], <o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>['05 Dome'],<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>['06 Lune', '07:41', '12:57', 'genova', 'livorno', ' ', '13:50', '19:08', 'siracusa', 'messina'], <o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>['22 Merc', 'Modifica'],<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>['29 Merc', 'Modifica']]<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;line-height:14.25pt;background:#FFFFFE'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p></div></div></div></div></div><div><p class=MsoNormal><span style='color:#1F497D'>Ciao Giorgio, <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>questo risolve solo la parte ‘Modifica’, ma devo anche risolvere il problema di eliminare tutte le città.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Comunque grazie, un tassello alla volta.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Marcello<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p></div></div></div></body></html>