File Handling Text Files

Quiz
•
Instructional Technology
•
12th Grade - University
•
Hard
Remya Pillai
Used 20+ times
FREE Resource
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of ‘r’ as prefix in the given statement? f = open(r “d:\color\flower.txt”)
To make it relative string
To make it new string
To make it raw string
To make it reverse string
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A file object is also known as
File handle
File copy
File directory
File link
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To force python to write the contents of file buffer on to storage file,........method may be used.
buffer()
write()
close()
flush()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does strip() function do?
Removes the trailing or leading spaces, if any.
Deletes the file
Remove the file object
Removes all the spaces between words
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which option is correct about this program? f=open(“ss.txt”,”wb”) print(“Name of the file:”,f.name) f.flush() f.close()
Compilation error
Runtime error
No output
Flushes the file when closing them
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to break the link of file object and the file on the disk.
open
close
break
end
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Yashi wants to check whether her name is listed in Shortlisted.dat or not. Which command she can write to open the file:
a=open(“Shortlisted.dat”,”rb”)
with open (“Shortlisted.dat’,’rb”) as a:
None
Both a and b
Similar Resources on Wayground
11 questions
untitled

Quiz
•
8th Grade - University
10 questions
Adobe Visual Design II Mod 3.00

Quiz
•
12th Grade
10 questions
Google Drawings

Quiz
•
3rd - 12th Grade
10 questions
22AD003

Quiz
•
University
10 questions
Quis Teknologi Layanan Jaringan

Quiz
•
7th Grade - University
10 questions
Data Types

Quiz
•
12th Grade
10 questions
Professional Opportunities with Linux

Quiz
•
University
8 questions
CYBERCRIME

Quiz
•
7th - 12th Grade
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
10 questions
Afterschool Activities & Sports

Quiz
•
6th - 8th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
15 questions
Cool Tool:Chromebook

Quiz
•
6th - 8th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
3rd Grade
20 questions
Bullying

Quiz
•
7th Grade
18 questions
7SS - 30a - Budgeting

Quiz
•
6th - 8th Grade