
Test8

Quiz
•
Information Technology (IT)
•
9th - 12th Grade
•
Medium
Rares Hampi
Used 2+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will f.read() return after reaching EOF in a .txt file?
Raises EOFError
Returns empty string
Returns None
Loops to the beginning
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What happens if you use f.write("data") on a file opened with "r" mode?
Writes normally
Truncates the file first
Raises io.UnsupportedOperation
Returns False
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which is true about with open(...) as f: block?
It closes the file only on success
File stays open after the block ends
It guarantees file closure even on exceptions
Cannot be used with binary files
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does f.readlines() return by default?
A single string
List of lines with trailing newline characters
List of stripped strings
Generator
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What’s the result of calling f.write("abc\n", "def\n")?
Writes both lines
Writes only the first
SyntaxError
TypeError
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
In CSV, what is the purpose of newline="" in open()?
Prevents empty columns
Combines rows
Prevents extra blank lines (Windows)
Forces UTF-8
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following uses keys to access values directly?
csv.reader
csv.writer
csv.DictReader
csv.reader with delimiter
Create a free account and access millions of resources
Similar Resources on Wayground
30 questions
3 EOT

Quiz
•
11th Grade
31 questions
Quiz Google Colab 3

Quiz
•
10th Grade
25 questions
Remidi PTS Gasal

Quiz
•
12th Grade - University
26 questions
Programming CFE Review #1

Quiz
•
10th Grade
30 questions
Test3

Quiz
•
9th - 12th Grade
30 questions
Pandas MCQ Quiz

Quiz
•
12th Grade - University
25 questions
Python - Chapter 3 Practice Quiz

Quiz
•
12th Grade
33 questions
Computer Science Examination Paper A - Allowed Items

Quiz
•
12th Grade
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade