Hey, welcome back.
In this video, we will replace this first line.
With this I.D. with capital letters, Cuomo amount comma cost.
So when we run the Python script, this line will be replaced to this text.
Let's do this.
Let's open merge that.
See, as we file, that is a file that has to be changed in read mode first as file.
And we get the contents file that's read the lines.
So this method gives us a list of all the lines so that we can work on a line level.
We've at least known.
We see something like content zero equals two.
That's shrink I.D. coma amount of cost.
So what that does is this let's suppose we have this list a a sequel to a one to three.
If you see the item within the zero has to be replaced with, let's say this.
String, what you get is a list with this new item as the first item, the item with index zero.
So that is what we're doing here.
And then you open the file again in right mo this time.
And you can use roids lines and just pass content there, the list.
So this is one way to do it.
You run that merge that see us view now has these new content with this new line.
But we forgot to add a backslash here, so let me run again.
Yeah, now it looks fine.
So that is one way to do it the other way, which I think it would be unnecessary would be to convert
to the least into a string using the joint methods which we used in the previous video of then use rides
to ride the string in the file.
So rides, who works with strings and writes lines, works with lists.
So this is a list that is the equivalent of read lines.
So that's completes this vigil.
Thank you.
And let's do some more.