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

Quiz
•
Computers
•
12th Grade
•
Medium
Amy Austin
Used 17+ times
FREE Resource
13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
Similar Resources on Quizizz
17 questions
Exceptions in Pythons

Quiz
•
12th Grade
16 questions
Python basics

Quiz
•
9th - 12th Grade
10 questions
Error Handling

Quiz
•
12th Grade
10 questions
Technical Terms - Internet (A-Z) - PPC

Quiz
•
12th Grade
8 questions
Python - 3.4.13 - Lists Quiz

Quiz
•
12th Grade
11 questions
Soal Photoshop Dasar 1

Quiz
•
1st Grade - University
13 questions
Binary files in Python

Quiz
•
12th Grade
8 questions
Python Exceptions and Debugging

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade
Discover more resources for Computers
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade
65 questions
MegaQuiz v2 2025

Quiz
•
9th - 12th Grade
10 questions
GPA Lesson

Lesson
•
9th - 12th Grade
15 questions
SMART Goals

Quiz
•
8th - 12th Grade
45 questions
Week 3.5 Review: Set 1

Quiz
•
9th - 12th Grade