Python File Handling Quiz

Quiz
•
Computers
•
12th Grade
•
Medium
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
Similar Resources on Wayground
15 questions
Python Basics Quiz

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

Quiz
•
12th Grade
10 questions
Executing SQL Commands With Python

Quiz
•
12th Grade - University
10 questions
Tecnothon Quiz (Selection Round)

Quiz
•
11th Grade - University
14 questions
File Handling in Python

Quiz
•
12th Grade
16 questions
Python basics

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

Quiz
•
12th Grade
10 questions
KS3 - Fun Computing Quiz 2

Quiz
•
4th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade