
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
25 questions
Electronic Components
Quiz
•
9th - 12th Grade
25 questions
2.6 The Internet Address (IPv4 & IPv6)
Quiz
•
11th - 12th Grade
25 questions
Modern Technologies
Quiz
•
10th - 11th Grade
25 questions
InDesign q1
Quiz
•
9th - 12th Grade
25 questions
Lesson 4_Advanced Motion Tweening
Quiz
•
9th - 12th Grade
23 questions
Basic Computer Cables and Ports
Quiz
•
9th - 12th Grade
22 questions
Steve Jobs
Quiz
•
6th - 12th Grade
22 questions
PowerPoint 2013
Quiz
•
9th - 12th Grade
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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade