G10 CS File Handling

Quiz
•
Computers
•
12th Grade
•
Hard

Fritz Bansag
Used 8+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code do?
f=open("test.txt")
Opens the file
in WRITE mode
Opens the file
in READ mode
Opens the file
both
READING and WRITING
Syntax Error
None of the choices
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens when you try to open a file that does not exist using the code?
with open("test.txt",'w') as f:
A new file is created
Error message
pops up
Nothing happens
None of the above
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does opening a file in mode ‘a’ mean?
with open("test.txt“, ‘a’) as f:
Open test.txt
for reading
Open test.txt
for writing
Open test.txt for appending text at the end of the file
None of the file
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
See the test1.txt file content to answer
This is now opened using this code: f=open("test1.txt",'r')
What is the output of f.read(15) ?
'This is a text file'
'This is a text'
'This is a text '
None of the above
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
See the test1.txt file content to answer
This is now opened using this code: f=open("test1.txt",'r')
What is the output of f.read(15) ?
'This is a text file'
'This is a text'
'This is a test '
None of the above
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
'as three lines.\nI am processing it using Python.‘
‘has three lines.\nI am processing it using Python.'
'This is a text file.\nIt has three lines.\nI am processing it using Python.'
None of the above
Create a free account and access millions of resources
Similar Resources on Wayground
8 questions
SmartNotes 3

Quiz
•
9th - 12th Grade
9 questions
Command Line

Quiz
•
12th Grade - Professi...
10 questions
12th cs cha13

Quiz
•
12th Grade
10 questions
Windows 10 System Management Tools

Quiz
•
9th Grade - University
10 questions
RUNG CHUÔNG VÀNG

Quiz
•
11th - 12th Grade
15 questions
File Types and Formats Quiz

Quiz
•
8th Grade - University
10 questions
Wrażenia globlne w Linxie

Quiz
•
10th Grade - University
15 questions
MS Excel - Managing Workbooks and Worksheets

Quiz
•
12th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade