Python files and exceptions

Quiz
•
Computers
•
11th Grade
•
Medium

turgut kalfaoglu
Used 4+ times
FREE Resource
17 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output-
f=open('abc.txt','a')
text="xyz"
f.write(text)
f.close()
Writing into the file without erasing old content
Writing into the file by erasing old content
reading from the file without erasing old content
reading from the file by erasing old content
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Mode in the following program to open file for writing in a mode where new data will be added at the end of old data
file =open("poem.txt","__")
r
w
a
r+
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the correct statement to close a file stream named myfile:
myfile.terminate()
myfile.end()
myfile.close()
myfile.remove()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function read single line at a time?
read()
read(n)
readline()
readlines()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Where files are store permanently?
RAM
Hard Disk
Cache memory
None of these
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Q.2 Which of the following statements are not true regarding the opening modes of a file?
When you open a file for reading, if the file does not exist, an error occurs.
When you open a file for writing, if the file does not exist, an error occurs
When you open a file for writing, if the file does not exist, a new file is created.
When you open a file for writing, if the file exists, the existing file is overwritten with the new file.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
TIKamy po angielsku

Quiz
•
9th - 12th Grade
15 questions
Creative iMedia RO88 Digital Sound

Quiz
•
9th - 11th Grade
20 questions
Network ports

Quiz
•
1st Grade - University
19 questions
Getting Started with MS Office

Quiz
•
7th - 12th Grade
15 questions
FILE MANAGEMENT

Quiz
•
KG - University
15 questions
Databases

Quiz
•
10th Grade - University
21 questions
Microsoft Word

Quiz
•
9th - 12th Grade
20 questions
Metal Lathe

Quiz
•
9th - 12th 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
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
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