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
14 questions
Archivos Digitales

Quiz
•
9th Grade - University
15 questions
Comkrumilk

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

Quiz
•
8th Grade - University
13 questions
Linux File Paths & Navigation

Quiz
•
12th Grade
10 questions
ASESMEN SUMATIF FILE DAN FOLDER

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

Quiz
•
12th Grade
10 questions
M1L4 6th Grade

Quiz
•
6th Grade - University
10 questions
files + pyQt notes

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade