Python Files I/O

Quiz
•
Computers
•
6th - 12th Grade
•
Medium
Karina Shrestha
Used 25+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
1 min • 1 pt
Given the file rockets_nasa.txt, which of the following is the correct way to open the file for reading as a text file? Select all that apply.
open('rockets_nasa.txt')
open('rockets_nasa.txt', 'r')
open('rockets_nasa.txt', 'a')
open('rockets_nasa.txt', 'w')
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is not a method of opening files?
Replace
Append
Write
read
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the data type of data that is read in from a file?
real
integer
boolean
string
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Appending "flour" to your "grocery.txt" file will place the item at the start of the file.
True
False
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does strip() do?
adds in random bytes of data
splits the file
removes spaces at the beginning and at the end of the string
removes spaces at the beginning and at the end of the file
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does readlines() do?
reads all of the lines in the file and creates a list with one line of text in each item of the list
reads in one line from a file and doesn't create a list
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the last action that must be performed on a file? (after it has been opened for r/w/a mode)
save the file
close the file
rewrite the file
none of the above
8.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct syntax for a newline character and a tab character?
/n, /t
/t, /n
/new, /tab
/n, /tab
Similar Resources on Wayground
8 questions
СОР (пересдача) 10 класс

Quiz
•
10th Grade
10 questions
2nd term ict

Quiz
•
6th Grade
10 questions
Tecnothon Quiz (Selection Round)

Quiz
•
11th Grade - University
10 questions
uji materi Informatika kelas 8 bab 3 TIK

Quiz
•
8th Grade - University
10 questions
Microsoft Office Quiz

Quiz
•
9th Grade
10 questions
Windows 10 System Management Tools

Quiz
•
9th Grade - University
10 questions
ICT Computing Essentials - Lesson 3: Computer Software

Quiz
•
6th - 8th Grade
10 questions
Bab 3 Ekstensi File

Quiz
•
7th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
8 questions
Time Management

Quiz
•
6th Grade
15 questions
Acceptable Use Policy (Quiz)

Quiz
•
6th - 8th Grade
25 questions
Career Vs. Job

Quiz
•
6th - 8th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade