Peter Otten wrote: >>> Will your program handle empty lines of input correctly? >> Strangely enough, it seems to do so, but why? > > Because there aren't any. When you read lines from a file there will always > be at least the newline character. Otherwise it would indeed fail: Except possibly for the last line.