Python File Handling Quiz

Python File Handling Quiz

12th Grade

13 Qs

quiz-placeholder

Similar activities

Programing Revision

Programing Revision

7th - 12th Grade

15 Qs

Writing files in python

Writing files in python

9th - 12th Grade

13 Qs

DATA FILE HANDLING

DATA FILE HANDLING

12th Grade

10 Qs

File Handling in Python

File Handling in Python

11th - 12th Grade

10 Qs

AP CSP - Python Lists and Arrays

AP CSP - Python Lists and Arrays

9th - 12th Grade

10 Qs

PYTHON FILES

PYTHON FILES

9th - 12th Grade

8 Qs

python

python

12th Grade

15 Qs

XII Practical Exam

XII Practical Exam

12th Grade

12 Qs

Python File Handling Quiz

Python File Handling Quiz

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Amy Austin

Used 17+ times

FREE Resource

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the key function for working with files in Python?

close()

file()

open()

read()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many parameters does the open() function take in Python?

One

Two

Three

Four

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the two parameters of the open() function in Python?

file and type

path and class

filename and mode

directory and access

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the "r" mode do when opening a file in Python?

Reads and writes to a file

Reads a file, creates a new file if it does not exist

Reads a file, error if the file does not exist

Reads a file, truncates the file first

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the "a" mode do when opening a file in Python?

Appends to a file, error if the file does not exist

Appends to a file, creates the file if it does not exist

Appends to a file, truncates the file first

Appends to a file, reads from the file first

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the "w" mode do when opening a file in Python?

Writes to a file, error if the file does not exist

Writes to a file, creates the file if it does not exist

Writes to a file, reads from the file first

Writes to a file, appends to the file if it exists

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the "x" mode do when opening a file in Python?

Creates the specified file, error if the file does not exist

Creates the specified file, appends to the file if it exists

Creates the specified file, truncates the file first

Creates the specified file, returns an error if the file exists

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?