33
44### Write Contents
55
6- For writing content to a file there are two scenarios
6+ For writing content to a file, there are two scenarios
77
88#### 1.write on existing file.
99for writing content to a file use following two modes in ** open()** function
1010
1111** Modes for writing file**
1212
1313#### 1. a
14- This will append the content at the end of file.
14+ This will append the content at the end of the file.
1515
1616#### 2. w
1717This will overwrite any existing content to a file.
@@ -45,7 +45,7 @@ Now **data.txt** contains
4545I am new text
4646```
4747
48- Example for appending content
48+ Example of appending content
4949File ** data.txt** contains
5050```
5151Hi,
@@ -74,7 +74,7 @@ To create a new file in Python, use the **open()** method, with one of the foll
7474
7575** 1.x**
7676- Exclusive create.
77- - will create a file, returns an error if the file exist .
77+ - will create a file, returns an error if the file exists .
7878
7979** 1.a**
8080- Append mode.
@@ -84,7 +84,7 @@ To create a new file in Python, use the **open()** method, with one of the foll
8484- Write mode.
8585- will create a file if the specified file does not exist.
8686
87- You can use above modes to create a empty file using ** open()** methods
87+ You can use the above modes to create an empty file using ** open()** methods
8888
8989Example:
9090Consider there is no file named ** mydata.txt** inside current directory.
@@ -124,7 +124,7 @@ lines=['hello','hi']
124124fil.writelines(lines)
125125```
126126
127- If you check content of file ** mydata.txt**
127+ If you check the content of file ** mydata.txt**
128128```
129129hello
130130hi
0 commit comments