File Handling in Python MCQ for CBSE Class 12 Computer Science students. Important Objective Questions from NCERT and Sumita Arora Python Book for examination point of view.
Q.1. A text file stores information in ASCII or Unicode characters as per
1) the compiler
2) the interpreter
3) As per programming platform
4) computer monitor
Q.2. In Python, by default this EOL character is the
Q.3.In which format Binary file contains information
1) Zebra way
2) Quick response code
3) same format in which the data is held in memory.
4) ASCII Format
Q.4.Is there a delimiter for binary files.
Q.5.What is easier for a program to read and write.
1) Binary file
2) Text file
3) Doc file
4) Excel file
Q.6. for opening of the file. Which command is used.
Q.7.What does this code myfile=open(“taxes.txt”).
1) opens the taxes.txt in default read mode.
2) opens the taxes.txt in default write mode.
3) opens the taxes.txt in default append mode.
4) opens the taxes.txt in default read and write mode.
Q.8. What are file object.
File object are used to read and write data to a file on disk.
Q.9. Which is of this is binary file mode?
Q.10.Which of the following file-modes does retains file data and append new data.
Q.11.File is created if does not exist. If the file exists, file is truncated( past data is lost). Both reading and writing operation can take place. What is the text file mode?
Q. f = open(“data.txt”)
Q.12.Identify name of file.
Q.13.Identify name of function.
Q.14.What if ‘f’ in above code?
Q.15.The above statement will __________ file in ________ mode.
Q.16.Reads some bytes from the file and returns it as a string.
Q.17. Reads a line at a time.
Q.18. Reads all the lines from the file and returns in the form of list.
Q.19. Write a string in file.
Q,20. Writes a list in a file.
Q.21.The output and input devices are implemented as files.
Q.22. There are three standard streams: stdin(standard input), stdout(standard output) and stderr(standard error).
Q.23.The relative paths are relative to current working directory denoted as a dot(.) while its parent directory is denoted with __________.
Thank you for attempting File Handling in Python MCQ for CBSE Class 12 !!!
File Handling in Python Class 12 Solutions – CS Study
8 thoughts on “File Handling in Python MCQ for Class 12 CBSE”
Very helpful nice mcqs I recommend everyone to learn mcqs from this site
Thanks for your valuable comment. We at csstudy.in gives the best material crafted by the best experienced Teachers. Again, Thanks a lot.
Hey… the questions were amazing but I think one of the answer’s wrong. Question 19)Write a string in a file. The answer it shows is “d.readlines()”. But the answer should be “a.write()”
Thanks for your observation. The MCQ has been corrected.
but it is very easy to answer by students.
not difficult but its moderate to answer.
need some output questions for better practice apart from that questions are cool and interesting
Thank you (:
the answer of que 10 ‘a+’ is wrong. the correct ans is ‘a’
a+ is the correct answer