[Tutor] Python Variables Changing in Other Functions
Rachel-Mikel ArceJaeger
arcejaeger at gmail.com
Thu May 26 15:57:36 CEST 2011
Yes it does! Thank you.
Rachel
On May 25, 2011, at 8:34 PM, Wayne Werner wrote:
> On Wed, May 25, 2011 at 10:17 PM, Rachel-Mikel ArceJaeger <arcejaeger at gmail.com> wrote:
> You asked for the traceback. All I get is this:
> ---------------------
>
> python a2.py
> File "a2.py", line 20
> titles = [title in myFile if title not in ["\n",""]]
> ^
> SyntaxError: invalid syntax
>
> Ahah. You're missing the important part:
>
> titles = [title for title in myFile if title not in ["\n",""]]
>
> you're missing the "title for" part. That should fix it.
>
> HTH,
> Wayne
R.M. ArceJaeger
Author/Publisher, Platypus Press
Contact: arcejaeger at gmail.com
Website: http://rmarcejaeger.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110526/1f1b31f5/attachment.html>
More information about the Tutor
mailing list