Test8

Test8

9th - 12th Grade

30 Qs

quiz-placeholder

Similar activities

Understanding the concept of list

Understanding the concept of list

11th Grade

25 Qs

Python Programming Quiz

Python Programming Quiz

9th - 12th Grade

25 Qs

Pandas MCQ Quiz

Pandas MCQ Quiz

12th Grade - University

30 Qs

Python - Chapter 3 Practice Quiz

Python - Chapter 3 Practice Quiz

12th Grade

25 Qs

Computer Science Examination Paper A - Allowed Items

Computer Science Examination Paper A - Allowed Items

12th Grade

33 Qs

Вопросы по бизнес-аналитике

Вопросы по бизнес-аналитике

10th Grade

33 Qs

G9-Introduction to Python Programming

G9-Introduction to Python Programming

9th Grade - University

25 Qs

Quiz Google Colab 3

Quiz Google Colab 3

10th Grade

31 Qs

Test8

Test8

Assessment

Quiz

Information Technology (IT)

9th - 12th Grade

Medium

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?