
24-25 file handling
Authored by Deepti Gupta
Computers
11th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
27 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To open a file c:\test.txt for reading, we should give the statement:
file1 = open(“c:\test.txt”,”r”)
file1 = open(“c:\\test.txt”,”r”)
file1 = open(file=”c:\test.txt”,”r”)
file1 = open(file=”c:\\s test.txt”,”r”)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To open a file c:\ test.txt for writing, we should use the statement:
fobj = open(“c:\test.txt”,”w”)
fobj = open(“c:\\test.txt”,”w”)
fobj = open(file=”c:\test.txt”,”w”)
fobj = open(file=”c:\\test.txt”,”w”)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To open a file c:\ test.txt for appending data, we can give the statement:
fobj = open(“c:\\test.txt”,”a”)
fobj = open(“c:\\test.txt”,”rw”)
fobj = open(file=“c:\test.txt”,”w”)
fobj = open(file=“c:\\ test.txt”,”w”)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is/are true?
when we open a file for reading, if the file does not exist, an error occurs.
when we open a file for writing, if the file does not exist, a new file is created.
when we open a file for writing, if the file exists, the existing file is overwritten with the new file.
All of these
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To read the entire contents of the file as a string from a file object fobj, the command should be:
fobj.read(2)
fobj.read()
fobj.readline()
fobj.readlines()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following snippet?
True
False
None
Error
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
22 questions
AS Data Types and Programming Constructs
Quiz
•
10th - 12th Grade
22 questions
AdobePageMaker
Quiz
•
11th Grade
22 questions
Round 1: Hack The Quest
Quiz
•
8th Grade - University
22 questions
CSA unit1 vocabulary quiz
Quiz
•
11th Grade
25 questions
UH 1 - Administrasi Sistem Jaringan
Quiz
•
11th Grade
24 questions
Fourth Grade March Rivision
Quiz
•
4th Grade - University
23 questions
1-2 тарау
Quiz
•
11th Grade
28 questions
MAWD 1.01 B
Quiz
•
KG - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
22 questions
El Imperfecto
Quiz
•
9th - 12th Grade
15 questions
ACT Reading Practice
Quiz
•
11th Grade
20 questions
SSS/SAS
Quiz
•
9th - 12th Grade
20 questions
verbos reflexivos en español
Quiz
•
9th - 12th Grade
14 questions
Making Inferences From Samples
Quiz
•
7th - 12th Grade
23 questions
CCG - CH8 Polygon angles and area Review
Quiz
•
9th - 12th Grade
8 questions
Momentum and Collisions
Lesson
•
9th - 12th Grade