1.

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”)This question was posed to me during an interview.My query is from Files topic in division Regular Expressions and Files of Python

Answer» RIGHT ANSWER is (a) outfile = OPEN(“c:\\scores.txt”, “a”)

The EXPLANATION is: a is used to indicate that data is to be APPENDED.


Discussion

No Comment Found

Related InterviewSolutions