Reading and writing of text files

--Originally published at Py(t)hon

Computers can also read and write, for them to do so we have to first create a .txt file and we do this by typing file = open(“file name”, “action”).

The next thing that we can do are the next ones:

  • “w” this is use to write in a .txt file
  • “r” this is use to read
  • “a” open the file for apending

Here is an example:

txt1

That’s all #Pug#ISC#Tec#NoMore#Python#TextFiles