To open a file c:\scores.txt for writing, we use
A. outfile = open(“c:\scores.txt”, “r”)
B. outfile = open(“c:\\scores.txt”, “w”)
C. outfile = open(file = “c:\scores.txt”, “r”)
D. outfile = open(file = “c:\\scores.txt”, “o”)
Answer:B
To open a file c:\scores.txt for writing, we use
A. outfile = open(“c:\scores.txt”, “r”) B. outfile = open(“c:\\scores.txt”, “w”) C. outfile = open(file = “c:\scores.txt”, “r”) D. outfile = open(file = “c:\\scores.txt”, “o”)