To open a file poem.txt for reading, the correct syntax is___________
File Handling Revision- Text file Handling Quiz 1

Quiz
•
Computers
•
12th Grade
•
Hard
Subhashini S
Used 119+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
file=open('poem.txt','r')
file=open(file='poem.txt','r')
fileopen=('poem.txt','r')
f=('poem.txt','w')
2.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
To read the entire contents of a text file as a string from a file object fobj , the correct syntax is _____________
fobj.read()
fobj.read(all)
fobj.readlines()
fobj.readline(18)
3.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
To read 18 characters from the file object fobj , the correct syntax is ____________.
fobj.readlines(18)
fobj.readchar(18)
fobj.read(18)
fobj.readline(18)
4.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Mention the data type of variable check in the following statements?
a. check=f.read()
b. check=f.readline()
c. check=f.readlines()
a. str b. str c. list
a. list b. str c. list
a. str b. list c. list
a. str b. list c. str
5.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
'w+' mode will _________________
first write the file by deleting the contents of the existing file, if the file exists.
first read the file and then write the contents by deleting its contents, if the file exists.
first write and then read the file contents, by deleting the contents of the file if the file exists.
first read and then write the contents, by deleting the contents of the file if the file exists.
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
_____ function will break the link of file object and file on the disk
open()
read()
write()
close()
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
_____ function without any argument removes leading and trailing whitespaces.
strip()
lstrip()
rstrip()
trim()
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
File Management

Quiz
•
9th - 12th Grade
16 questions
File Handling Quiz

Quiz
•
12th Grade
15 questions
file handling

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

Quiz
•
12th Grade
18 questions
File Types

Quiz
•
12th Grade
15 questions
File Formats

Quiz
•
9th - 12th Grade
15 questions
CUET Level - II Computer Science(7/11/2023)

Quiz
•
12th Grade
20 questions
File i/o

Quiz
•
10th Grade - University
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