[Tutor] Simple Question...

Jacob S. keridee at jayco.net
Fri Oct 22 04:00:13 CEST 2004


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