Python File Handling Quiz

Python File Handling Quiz

12th Grade

13 Qs

quiz-placeholder

Similar activities

File Handling - Introduction

File Handling - Introduction

12th Grade

15 Qs

PI Mod 1 quiz

PI Mod 1 quiz

9th - 12th Grade

10 Qs

ÔN TẬP BÀI 16 - K10

ÔN TẬP BÀI 16 - K10

10th Grade - University

10 Qs

FILE HANDLING

FILE HANDLING

12th Grade

14 Qs

Binary File Handling Python

Binary File Handling Python

12th Grade

10 Qs

Saving Files

Saving Files

4th - 12th Grade

15 Qs

Revision - CSV File Handling

Revision - CSV File Handling

12th Grade

15 Qs

Python: Chapter 6 - True or False

Python: Chapter 6 - True or False

8th Grade - University

9 Qs

Python File Handling Quiz

Python File Handling Quiz

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Amy Austin

Used 18+ 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?