What does the following code do?
f=open("test.txt")
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
10 questions
File Handling
Quiz
•
12th Grade
15 questions
Linux-2 Quiz 2 -- LAMP
Quiz
•
1st - 12th Grade
15 questions
File Formats
Quiz
•
9th - 12th Grade
13 questions
Writing files in python
Quiz
•
9th - 12th Grade
12 questions
Quiz Input Python
Quiz
•
12th Grade
10 questions
LUA Test
Quiz
•
9th Grade - University
15 questions
File Handling in Python - Grade 12 CBSE
Quiz
•
12th Grade
10 questions
Python Basic files
Quiz
•
10th - 12th Grade
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
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