What will be the output-
f=open('abc.txt','a')
text="xyz"
f.write(text)
f.close()
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.
14 questions
PHOTOSHOP ACA CERTIFICATION
Quiz
•
9th - 12th Grade
20 questions
adobe photoshop 2015 certification quiz 2
Quiz
•
9th - 12th Grade
20 questions
Programming Fundamentals Part 2
Quiz
•
9th - 11th Grade
20 questions
10.3 Files Cambridge iAS 9618
Quiz
•
11th Grade
15 questions
File Formats
Quiz
•
9th - 12th Grade
15 questions
J276 OCR CS File Handling
Quiz
•
9th - 11th Grade
20 questions
Kuis Komputer Akuntansi
Quiz
•
11th Grade
15 questions
InDesign and Typography
Quiz
•
9th - 12th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University