<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>Il giorno 18/nov/06, alle ore 14:26, Sandro Dentella ha scritto:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Sat, Nov 18, 2006 at 02:12:52PM +0100, <A href="mailto:gheremedin.daniele@alice.it">gheremedin.daniele@alice.it</A> wrote:</DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">   </SPAN>salve community di python, devo eliminare degli spazi da una lista.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">   </SPAN>la lista fino a 9 ha spazi e poi no</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">   </SPAN>c=['1',' ','2',' ',3,' ','4',' ','5',' ','6',' ','7',' ','8','</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">   </SPAN>','9','10','11','12','13']</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">c = [x for x in c if not x == ' ']</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">oppore, forse meglio:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">for i in range(9):</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">    </SPAN>if c[i] == ' ':</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">        </SPAN>del c[i]</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV></BLOCKQUOTE></DIV><BR><DIV>Mi piace di pių la prina forma ma suggerirei a Danieli di provarla anche sulle lettere... non si sa mai:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>c=['R',' ','T',' ','F',' ','M']</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>poi controlla qui il risultato per vedere se č giusto :<A href="http://it.wikipedia.org">http://it.wikipedia.org</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>:)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>G</DIV><DIV><FONT class="Apple-style-span" color="#001BC7" face="Arial" size="4"><SPAN class="Apple-style-span" style="font-size: 16px; text-decoration: underline;"><BR class="khtml-block-placeholder"></SPAN></FONT></DIV></BODY></HTML>