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

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
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
10 questions
GCSE J277 - Computational Thinking Keyword Quiz
Quiz
•
7th Grade
10 questions
LAT BAB V INFORMATIKA KELAS 7
Quiz
•
7th Grade
10 questions
แบบทดสอบก่อน - หลัง เรียนการใช้เครี่องมือสร้างหนังสือ E- book
Quiz
•
8th Grade
10 questions
RESPONSIBLE USE OF ICT
Quiz
•
4th - 6th Grade
11 questions
Website constructs
Quiz
•
6th - 8th Grade
10 questions
Year 7 Historical development of Computers
Quiz
•
7th Grade
11 questions
Ethical Issues of I.T.
Quiz
•
7th - 8th Grade
10 questions
Kiểm tra 15p tin học 7
Quiz
•
7th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade