Python File Handling Quiz

Python File Handling Quiz

12th Grade

13 Qs

quiz-placeholder

Similar activities

1.2.4. Types of Programming Language

1.2.4. Types of Programming Language

12th Grade

12 Qs

Numpy-1

Numpy-1

9th - 12th Grade

10 Qs

Word 2016 Lesson 1

Word 2016 Lesson 1

9th - 12th Grade

10 Qs

Computer Hardware - CPU & GPU

Computer Hardware - CPU & GPU

7th Grade - University

16 Qs

ICT as Platform for Change

ICT as Platform for Change

11th - 12th Grade

10 Qs

Cyber Security Quiz

Cyber Security Quiz

12th Grade

10 Qs

emtech

emtech

12th Grade

10 Qs

Visual Basic 2010

Visual Basic 2010

8th Grade - University

10 Qs

Python File Handling Quiz

Python File Handling Quiz

Assessment

Quiz

Computers

12th Grade

Practice Problem

Medium

Created by

Amy Austin

Used 18+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?