Computer Science, asked by Peekaachu8483, 11 months ago

How to read a file in python

Answers

Answered by Anonymous
0

Answer:

  1. Python allows you to read, write and delete files.
  2. Use the function open("filename","w+") to create a file. ...
  3. To append data to an existing file use the command open("Filename", "a")
  4. Use the read function to read the ENTIRE contents of a file.
  5. Use the readlines function to read the content of the file one by one.
Answered by sabarish007
0

Answer:

file=open("c:\\python programs\\test.txt","r")

doc=file.read()

Explanation:

Mark me as a BRAINLIST plzzz

Similar questions