Why is "while" ticking me off???

Alex Martelli aleaxit at yahoo.com
Tue Nov 21 09:24:08 CET 2000


"Tyler Eaves" <tyler at tylereaves.com> wrote in message
news:39dd2419.1980055 at news.geeksnet.com...
> On Thu, 05 Oct 2000 19:58:25 -0400, Thomas Gagne
> <tgagne at ix.netcom.com> wrote:
>
> This works:
>
> a=fp.readlines()
> for x in a[]:
>    do something

No, it's a syntax error.  But if you remove the empty brackets
on the for-statement line:
    for x in a:
then it does work fine.


Alex






More information about the Python-list mailing list