File Handling

Quiz
•
Computers
•
12th Grade
•
Medium
Gunachitra thiayagarajan
Used 187+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Select the statement to open a file named MYDATA.dat in read binary mode. Let the file object name be myfile.
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 Wayground
10 questions
Python: práce se soubory (opakování)

Quiz
•
12th Grade
10 questions
MOAC Excel 2016 Lesson 03

Quiz
•
8th - 12th Grade
14 questions
PHOTOSHOP ACA CERTIFICATION

Quiz
•
9th - 12th Grade
15 questions
File Handling in Python - Grade 12 CBSE

Quiz
•
12th Grade
10 questions
Sistem Operasi

Quiz
•
12th Grade
12 questions
file python

Quiz
•
12th Grade
15 questions
File Formats

Quiz
•
9th - 12th Grade
10 questions
Python Basic files

Quiz
•
10th - 12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
6 questions
Maier - AMDM - Unit 1 - Quiz 1 - Estimation

Quiz
•
12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade
21 questions
9th Grade English Diagnostic Quiz

Quiz
•
9th - 12th Grade
7 questions
Characteristics of Life

Interactive video
•
11th Grade - University