Python Basic files

Quiz
•
Computers
•
10th - 12th Grade
•
Medium
James Abela
Used 216+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
This command will open MyFile = open("MyText.txt")
To read the file
To append to the file
To write to the file
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
If I want to add to the end of a text file, I should:
MyCipher = open("MyCipher.txt", "w")
MyCipher = open("MyCipher.txt", "a")
MyCipher = open("MyCipher.txt", "w+")
MyCipher = open("MyCipher.txt", "s")
3.
MULTIPLE SELECT QUESTION
20 sec • 1 pt
Which of these will generate an error?
MyCipher.write("writing")
MyCipher..write(writing)
MyCipher.write("writing",writing)
MyCipher.readline()
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you close the file?
MyFile = close()
MyFile.close
close = MyFile()
MyFile.close()
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Why is it best to open a file with with in Python?
It automatically closes the file
Easier to read the code
Better for binary files
Closers to the pseudocode
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which is the best type of loop to write a file in?
While loop
for loop
repeat loop
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What command can you use to separate parts of a line?
separate()
split()
divide()
cut()
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
File Formats

Quiz
•
9th - 12th Grade
14 questions
FILE HANDLING

Quiz
•
12th Grade
10 questions
File Handling

Quiz
•
12th Grade
13 questions
Binary files in Python

Quiz
•
12th Grade
10 questions
File Handling in Python

Quiz
•
11th - 12th Grade
15 questions
File Handling in Python - Grade 12 CBSE

Quiz
•
12th Grade
10 questions
Y10 Python Text Files

Quiz
•
10th Grade
12 questions
Text File Pop Quiz

Quiz
•
11th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade