Python File Handling Quiz

Python File Handling Quiz

12th Grade

13 Qs

quiz-placeholder

Similar activities

FILE HANDLING

FILE HANDLING

12th Grade

14 Qs

Writing files in python

Writing files in python

9th - 12th Grade

13 Qs

Python File Handling

Python File Handling

12th Grade

15 Qs

CUET Level - II Computer Science(7/11/2023)

CUET Level - II Computer Science(7/11/2023)

12th Grade

15 Qs

chapter 4 12 a

chapter 4 12 a

12th Grade

10 Qs

Binary File Handling Python

Binary File Handling Python

12th Grade

10 Qs

Python Final Assessment

Python Final Assessment

4th - 12th Grade

10 Qs

Text File - Quiz

Text File - Quiz

12th Grade - University

10 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?