Home / Engineering / Problem Solving and Python Programming / Question

M

Mr. Dubey • 51.17K Points
Coach

Q.) To open a file c:\scores.txt for appending data, we use                          

(A) outfile = open(“c:\\scores.txt”, “a”)
(B) outfile = open(“c:\\scores.txt”, “rw”)
(C) outfile = open(file = “c:\\scores.txt”, “w”)
(D) outfile = open(file = “c:\\scores.txt”, “w”)
Correct answer : Option (A) - outfile = open(“c:\\scores.txt”, “a”)

Explanation:
 a is used to indicate that data is to be appended.

Share

Discusssion

Login to discuss.