Select the correct answerTo open a file c:\scores.txt for reading, we use _____________Optionsinfile = open(“c:\scores.txt”, “r”)infile = open(file = “c:\scores.txt”, “r”)infile = open(file = “c:\\scores.txt”, “r”)infile = open(“c:\\scores.txt”, “r”)
Question
Select the correct answerTo open a file c:\scores.txt for reading, we use _____________Optionsinfile = open(“c:\scores.txt”, “r”)infile = open(file = “c:\scores.txt”, “r”)infile = open(file = “c:\scores.txt”, “r”)infile = open(“c:\scores.txt”, “r”)
Solution
The correct answer is:
infile = open("c:\scores.txt", "r")
Similar Questions
To open a file c:\scores.txt for reading, we use _____________
To open a file c:\scores.txt for appending data, we use ____________
Which of the following is a correct way to open a file in Python for reading?1 pointfile = open("file.txt", "w")file = open("file.txt", "r+")file = open("file.txt", "a+")file = open("file.txt", "rb")
How do you open a file for reading in Python?Question 6Answera.open(filename, 'a')b.open(filename, 'w')c.open(filename, 'b')d.open(filename, 'r')
What is the correct way to open a file named "example.txt" for reading in Python?Afile = open("example.txt", "r")Bfile = read("example.txt")Cfile = open("example.txt", "w")Dfile = read_file("example.txt")
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.