Reading and writing of text files

--Originally published at Sierra's Blog

How to create and read a text file:

Note:

“r” = read

“w” = write

“a”=add

the first line needs to be written necessary to work inside the text.

the second line format is used to write inside the text.

the third line will close the text.

the fourth line is used to open the text, the difference between the first and the fourth line is that the first line opens the text and let you modify it while the fourth line is only used to read it.

the fifth line is only going to print the text.

readingtextfiles

you should watch this video to learn more about this topic: