A.Opening a file in read mode performs which operation?
a. Creates a new file b. Reads consecutive characters from a file
c. Reads all the content of a file d. None of the above
B. If we have to open a fi le abc.txt using the statement
Fp1 = open(‘abc.txt’,’r’)
which statement will read the file into memory?
a. Fp2 = open(Fp1) b. FP1.Open.read(Fp1)
c. Fp1.read() d. None of the above
C. The inbuilt method readlines() is used to:
a. Read an entire file as a string b. Read one line at a time
c. Read each line in a file as an item in a list d. None of the above
D. If the statement Fp1 = open(‘demo.txt’,’r’) is used to open a fi le demo.txt in read mode then which statement will be used to read 5 string characters from a fi le into memory?
a. Ch = fp1.read[:10] b. Ch = fp.read(6)
c. Ch = fp.read(5) d. All of the above