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
13 questions
Linux File Paths & Navigation

Quiz
•
12th Grade
10 questions
ASESMEN SUMATIF FILE DAN FOLDER

Quiz
•
7th Grade - University
15 questions
MS Excel - Managing Workbooks and Worksheets

Quiz
•
12th Grade
9 questions
ÔN TẬP BÀI 15_ TIN 10

Quiz
•
10th Grade
8 questions
Internet Safety - South High

Quiz
•
3rd - 12th Grade
9 questions
OCR A Level Computer Science (H446) - Component 1.3.1 - Compression, Encryption and Hashing

Quiz
•
11th Grade - University
15 questions
File Types and Formats Quiz

Quiz
•
8th Grade - University
10 questions
Encryption 2

Quiz
•
8th - 10th 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
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

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

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade