A.Opens or creates a text file named python.csv to write
B.Opens or creates a text file named python.csv to append
C.Opens or creates a text file named python.csv to read
D.Opens a new file named python.csv to append
Correct Option: BExplanation: Opens or creates a text file named python.csv to append
Q: What will be the output after the following statements?
x = open('python.csv', 'a')
print(x.writable())
A.readable
B.writable
C.True
D.False
Correct Option: CExplanation: True
Q: What does the following statement do?
x = open('python.bat', 'wb')
A.Opens or creates a binary file named python.bat to write
B.Opens or creates a binary file named python.bat to append
C.Opens or creates a binary file named python.bat to read
D. Opens a new file named python.bat to write
Correct Option: AExplanation: Opens or creates a binary file named python.bat to write
Q: What will be the output after the following statements?
x = open('python.csv', 'w')
print(x.closed)
A.open
B.closed
C.True
D.False
Correct Option: DExplanation: False
Q: What will be the output after the following statements?
x = open('python.csv', 'w')
print(x.readable())
A.readable
B.writable
C.True
D.False
Correct Option: DExplanation: False
Q: What does the following statement do?
x = open('python.csv', 'w')
A.Opens or creates a text file named python.csv to write
B.Opens or creates a text file named python.csv to append
C.Opens or creates a text file named python.csv to read
D.Opens a new file named python.csv to write
Correct Option: AExplanation: Opens or creates a text file named python.csv to write
Q: What will be the output after the following statements?
x = open('python.csv', 'w')
x.close()
print(x.closed)
A.open
B.closed
C.True
D.False
Correct Option: CExplanation: True
Q: What does the following statement do?
x = open('python.csv', 'r')
A.Opens an existing text file named python.csv to write
B.Opens an existing text file named python.csv to append
C.Opens an existing text file named python.csv to read
D.Opens a new file named python.csv to read
Correct Option: CExplanation: Opens an existing text file named python.csv to read
Q: What does the following statement do?
x = open('python.txt', 'r+')
A.Opens a text file named python.txt to read from or write to
B.Opens a text file named python.txt to read
C.Opens a text file named python.txt to write
D.Opens a new file named python.txt to append
Correct Option: AExplanation: Opens a text file named python.txt to read from or write to
Q: To open a file c:\scores.txt for reading, we use
A.infile = open(
B.infile = open(
C. infile = open(file =
D.infile = open(file =
Correct Option: BExplanation:
Open () function creates a file object which would be utilised to call other methods associated with it. file object = open [file name (acess_mode]), (buffering)] open ( file name, [acess_mode] , [buffering] )