At first I totally misread this....<br><br>To get the set of letters, use<br><br>import string<br>string.ascii_letters<br><br>Then do what you said in your algorithm.<br><br>A shorthand way to do that is<br><br>filteredString = &#39;&#39;.join([c for c in foo if c in 
string.ascii_letters])<br clear="all"><br>-- <br>Michael Langford<br>Phone: 404-386-0495<br>Consulting: <a href="http://www.TierOneDesign.com/">http://www.TierOneDesign.com/</a><br>Entertaining: <a href="http://www.ThisIsYourCruiseDirectorSpeaking.com">
http://www.ThisIsYourCruiseDirectorSpeaking.com</a>
<br><br><div><span class="gmail_quote">On 9/17/07, <b class="gmail_sendername">Andrew Nelsen</b> &lt;<a href="mailto:sxkorean@gmail.com">sxkorean@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I was wondering, recently, the most expedient way to take a string with [@#$%^&amp;*] and alpha-numeric characters [ie. &quot;^@%#*$@*$g@)$&amp;^@&amp;^$F&quot;] and place all of the letters in a string or list. I thought there could be obvious ways:
<br><br>A) Find all the letters, put them in a list, one by one. Something like (I&#39;m not sure yet how I&#39;d do it...):<br><br>import string<br>list = {}<br>string = &quot;@*&amp;^$&amp;*^@$g*(&amp;@$*(&amp;$@c(*&amp;*(&amp;c^&amp;%&amp;^%&quot;
<br>for x in string:<br>&nbsp;&nbsp;&nbsp; if x &lt;is in string.letters?&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; list = list + [x]<br><br>B) Delete all the characters in the string that don&#39;t match string.letters:<br><br>No idea...strip()?<br><br>Thanks,<br>

<br>Drew<br>
<br>_______________________________________________<br>Tutor maillist &nbsp;- &nbsp;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Tutor@python.org">Tutor@python.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">
http://mail.python.org/mailman/listinfo/tutor</a><br><br></blockquote></div><br>