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
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
10 questions
Python Image Library

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

Quiz
•
12th Grade
11 questions
Python Library-1

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

Quiz
•
12th Grade
15 questions
CUET Level - II Computer Science(7/11/2023)

Quiz
•
12th Grade
16 questions
Python basics

Quiz
•
9th - 12th Grade
10 questions
Exploring Python: Input and Output Essentials

Quiz
•
9th Grade - University
10 questions
Error Handling

Quiz
•
12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
6 questions
Maier - AMDM - Unit 1 - Quiz 1 - Estimation

Quiz
•
12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade
21 questions
9th Grade English Diagnostic Quiz

Quiz
•
9th - 12th Grade
7 questions
Characteristics of Life

Interactive video
•
11th Grade - University