Question
a.
When you open a file for reading, if the file does not exist, an error occurs
b.
When you open a file for writing, if the file does not exist, a new file is created
c.
When you open a file for writing, if the file exists, the existing file is overwritten with the new file
d.
All of the mentioned
Posted under Python
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. Which of the following statements are true ?
Similar Questions
Discover Related MCQs
Q. What happens if no arguments are passed to the seek function?
View solution
Q. How do you change the file position to an offset value from the start?
View solution
Q. How do you delete a file?
View solution
Q. How do you rename a file?
View solution
Q. How do you get the current position within the file?
View solution
Q. How do you close a file object (fp)?
View solution
Q. Which of the following is not a valid attribute of a file object (fp)?
View solution
Q. How do you get the name of a file from a file object (fp)?
View solution
Q. What is the difference between r+ and w+ modes?
View solution
Q. Which of the following is not a valid mode to open a file?
View solution
Q. Which of the following is modes of both writing and reading in binary format in file.?
View solution
Q. Is it possible to create a text file in python?
View solution
Q. Which function is used to close a file in python?
View solution
Q. Which function is used to write a list of string in a file
View solution
Q. Which function is used to write all the characters?
View solution
Q. Which function is used to read single line from file?
View solution
Q. Which function is used to read all the characters?
View solution
Q. What is the use of “a” in file handling?
View solution
Q. What is the use of “w” in file handling?
View solution
Q. In file handling, what does this terms means “r, a”?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Python? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!
Java Programming
Level up your coding skills with our Java Programming MCQs. From object-oriented...
Cyber Security
Understand the fundamentals of safeguarding digital assets with our Cyber Security...