in reply to question about finding strings?

SaraBetsy:

Neither: it only reads from the file (the '<' part of the open statement). It won't change it or add anything to it.

The print statement is sending what it finds to the standard output stream, which will normally write to the console.

...roboticus

When your only tool is a hammer, all problems look like your thumb.