Select the statement to open a file named MYDATA.dat in read binary mode. Let the file object name be myfile.
File Handling

Quiz
•
Computers
•
12th Grade
•
Medium
Gunachitra thiayagarajan
Used 186+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
myfile=open("MYDATA.dat","rb")
myfile=open("MYDATA.dat","r+")
myfile=open("MYDATA.dat","r")
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Mode in the following program to open file for writing in a mode where new data will be added at the end of old data
file =open("poem.txt","__")
r
w
a
r+
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the correct statement to close a file stream named myfile:
myfile.terminate()
myfile.end()
myfile.close()
myfile.remove()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the ouput -
f=open('abc.txt','w')
x=f.read()
f.close()
print(x)
Error(not readable)
Error(not writable)
It will read all the data of the file.
none
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output-
f=open('abc.txt','a')
text="xyz"
f.write(text)
f.close()
Writing into the file without erasing old content
Writing into the file by erasing old content
reading from the file without erasing old content
reading from the file by erasing old content
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function is used to write multiple lines in text file?
write()
writelines()
lines()
print()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which statement(s) is/are true to open a binary file "Record.dat" for reading and writing ?
file =open("Record.dat","wb")
file =open("Record.dat","rb")
file =open("Record.dat","ab")
file =open("Record.dat","rb+")
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
File Handling in Python

Quiz
•
12th Grade
12 questions
file python

Quiz
•
12th Grade
10 questions
File Handling in Python

Quiz
•
11th - 12th Grade
10 questions
Excel

Quiz
•
11th - 12th Grade
15 questions
Logo Creation in Photopea

Quiz
•
7th Grade - University
8 questions
PYTHON FILES

Quiz
•
9th - 12th Grade
15 questions
CBSE Class 12 Computer Science 2023 Quiz

Quiz
•
12th Grade
13 questions
Binary files in Python

Quiz
•
12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University