
Text File Handling Set -1

Quiz
•
Computers
•
12th Grade
•
Medium
Anjali Luthra
Used 6+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which mode is taken as default mode for opening a File in Python?
r
a
w
None
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given a text file opened as file_in, which of the following will print the entire file?
print(file_in.read())
print(file_in.readline())
print(file_in.get())
for line in file_in:
print(line)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to open the file file_in.txt for reading?
open('file_in.txt','a')
open('file_in.txt','r+')
open('file_in.txt', 'r')
open('file_in.txt','w')
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following function is used to write data in text mode?
write
output
dump
send
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Given the following file opened as song_file:
I can't write one song that's not about you
Can't drink without thinkin' about you
Is it too late to tell you that
Everything means nothing if I can't have you?
What is the result of
print(text_file.readlines()[1]) ?
I can't write one song that's not about you
Can't drink without thinkin' about you
I can't write one song that's not about you
Can't drink without thinkin' about
you
Is it too late to tell you that
Everything means nothing if I can't have you?
I
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the best way to read an entire file into a list of strings?
.read()
.readline()
.readlines()
.read(all)
7.
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()
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
File Handling in Python

Quiz
•
12th Grade
16 questions
Quiz Pemrograman Java dengan netbeans

Quiz
•
10th Grade - University
20 questions
ULANGAN TIK KELAS 7

Quiz
•
12th Grade
20 questions
File Handling in C++

Quiz
•
12th Grade - University
20 questions
Informatyka - gimnazjum

Quiz
•
6th Grade - University
25 questions
BIM 1 Review

Quiz
•
9th - 12th Grade
18 questions
Chapter 2: Ethical and Legal Issues

Quiz
•
12th Grade
15 questions
Ôn tập học kì 1 Tin học 4

Quiz
•
4th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade