[Tutor] Introduction - log exercise

bob gailer bgailer at gmail.com
Wed Nov 18 02:22:18 CET 2009


Alan Gauld wrote:
>
> "Antonio de la Fuente" <toni at muybien.org> wrote
>> > if not line.isspace() and not line == 'foo':
>> >     fileOut.write(line)
>>
>> But then, the new log file will have all the blocks, even the ones that
>> had 'foo' on it, even if the foo lines weren't there anymore. No? or
>> is there anything that I don't get?
>
> I think the test should be:
>
> if not line.isspace and 'foo' not in line:
>     fileOut.write(line)
>

No - that misses the objective of eliminating blocks containing 'foo'


-- 
Bob Gailer
Chapel Hill NC
919-636-4239


More information about the Tutor mailing list