[Tutor] Simple Question...

Bill Mill bill.mill at gmail.com
Fri Oct 22 07:14:17 CEST 2004


line = ' '

there is a space inside the quotes, so line != None. An easy enough
mistake to make, since your email reader probably has a font set for
reading, not programming.

Peace
Bill Mill
bill.mill at gmail.com


On Thu, 21 Oct 2004 21:00:13 -0500, Jacob S. <keridee at jayco.net> wrote:
> Hi. I see one problem.
> 
> >def wcslow(f):
> >   line = ' '
> >   c = 0
> >   while line:
> >       line = f.read(1024)
> >       c += line.count('\n')
> 
> Your while loop will never execute because line == None. You can fix this by
> making line equal to "l" or some other string not equal to None.
> 
>


More information about the Tutor mailing list