We'll strip it, lin = lin.rstrip to take the whitespace off the right-hand side.
And now we're going to say print lin.
Again, I'm not just doing this.
I really, when I write code, I just saved it.
When I write code, I do this kind of stuff all the time just for
my own sanity checking.
And so now I'm going to run python3 ex_09.py just to test that.
I want to hit Enter now, and it's going to assume hopefully clown.txt
if it all goes well, and yep, it read one line. Okay?
So that part's working.
I'll just leave that print statement in.
The next thing I want to do is kind of a classic thing where we're going to go
read a bunch of lines and then go horizontally across those lines and words.
So I'm going to split that wds = lin.split and
print(wds) so I'll print that and
I'm going to save it and test it.
I really love to test things over and over there's the actual line.
This file clown.txt only has one line and it breaks it into words.
And so I have those words. Let's just run it again with intro.txt.
So this will have a lot of lines, line, line, line, line, line, lots of lines.
Every line has it prints out the line and
then prints out the words that we split it into, okay?
So now, one of the things that I do here is
now I sort of can believe everything from here up.
Like oh, it's going to open the file,
it's going to read through the lines and then split them into words.
And so then I'll just kind of behind it, I'll say, okay,
I'll just comment that out.
Now, I need another for loop for w in wds.
Now, wds is a python list and has some number of words in it.
0 or 12 or whatever was on the line.
And now I'm going to print out