
Python L34 Open File
Authored by Future Teacher
Computers
6th - 8th Grade
9 Questions
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following line do?
Reads the file and deletes it
Opens the file in write mode
Opens the file in read mode and assigns it to file
Creates a new file called data.txt
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Using with open(...) is a good practice because it automatically closes the file after use.
True
False
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What error will you get if you try to open a file that doesn’t exist in 'r' mode?
FileNotFoundError
PermissionError
IsADirectoryError
4.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
To add new content to the end of an existing file without erasing it, use mode '____'.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method reads all lines from a file and stores them in a list?
.read()
.readlines()
.write()
.print()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of this code if the file names.txt contains: Ali, Becky, Charles
1
2
3
0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why is 'w' mode dangerous if you open an existing file?
The 'w' mode overwrites the existing file, erasing all its content.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
11 questions
Cascading Style Sheets
Quiz
•
8th - 12th Grade
10 questions
7 ICT Sem 2 Reviewer
Quiz
•
7th Grade
10 questions
Kuis Analisis Data Kelas 7
Quiz
•
7th Grade
10 questions
Quiz 9 (15.09.2021)
Quiz
•
1st - 12th Grade
10 questions
EXCEL 1
Quiz
•
7th Grade
14 questions
Y9 - HTML - L4 - css RECAP
Quiz
•
7th Grade
10 questions
Working with tables
Quiz
•
5th - 12th Grade
10 questions
Blue Cross Websites
Quiz
•
7th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade