Class 12 File Handling MCQ Quiz | File Handling in Python class 12 MCQ Quiz

Preview

Class 12 File Handling MCQ Quiz | File Handling in Python class 12 MCQ Quiz



0%

Class 12 File Handling MCQ Quiz

1 / 63

Where will file pointer go after executing following code.
f=open("data.txt")
D=f.read()
print(D)

2 / 63

The relative paths are relative to the current working directory.

3 / 63

Which the following command is used to open a file "c:\pat.txt" for writing as well as reading in binary format only ?

4 / 63

The file mode to open a csv file for appending  as well reading is _____ .

5 / 63

To specify a different delimiter while writing into a csv file, ____ argument is used with csv.writer().

6 / 63

The types of operations that can be carried out on a file depend upon the file mode a file is opened in.

7 / 63

The other name for file object is _____ .

8 / 63

If the file already contains "good". What will be stored in file data.txt after executing following code.
f=open("data.txt")
f.write("Bye")
f.close()

9 / 63

______ function is used to write multiple lines of data in the form of nested list in a file.

10 / 63

Which of the following formats of files can be created programmatically through Python to store some data?

11 / 63

Which function is used to read a single line from file ?

12 / 63

The csv files can only take comma as delimiter.

13 / 63

To write a list in a file, _____ method may be used.

14 / 63

The file mode to open a text file for writing as well reading is _____ .

15 / 63

To read the remaining lines of the file from a file object fileinp, we use:

16 / 63

Find error in following code:
1. import pickle
2. data=[10,20,30]
3. fout=open("data1.dat", "rb")
4. pickle.dump(data,fout)
5. fout.close()

17 / 63

To open a file "c:\ss.txt" for appending data , we use

18 / 63

Which of the following mode will refer to binary data ?

19 / 63

Text file data.txt contains: I am a student.
What will following code print?
f=open("data.txt")
print(f.read(6))
f.close()

20 / 63

Which function is used to write all the characters in a file?

21 / 63

The dump() function of the pickle module performs unpickling.

22 / 63

The csv files are text files.

23 / 63

Function readline() and readlines() are essentially the same.

24 / 63

Which function is used to write a list of strings in a file ?

25 / 63

To read all the file contents in the form of a list, _____method is used.

26 / 63

Which the following command is used to open a file "c: \pat.txt" for writing in binary format only ?

27 / 63

If no path is given with a file name in the open () method, then the file must exist in the current directory.

28 / 63

In file handling, what does this term means "r", "a" ?

29 / 63

The character that separates the values in csv filers is called the _____.

30 / 63

When you open a file for writing, if the file does not exist, a new file is created.

31 / 63

The readlines() method returns

32 / 63

Which the following functions do you use to write data in the binary format ?

33 / 63

To read the next line of the from a file object infi , we use

34 / 63

What is the difference between r+ and w+ modes ?

35 / 63

The absolute paths are from the topmost level of the directory structure.

36 / 63

The two types of data files can be _____ files and ____ files.

37 / 63

To close an open file, _____ method is used.

38 / 63

Python automatically flushes the file buffers before closing a file with close() function.

39 / 63

The load() function of the pickle module performs pickling.

40 / 63

A _____ governs the type of operations (e.g., read/write/append) possible in the opened file.

41 / 63

When you open a file for writing, if the file exist, the existing file is overwritten with the new file.

42 / 63

We can suppress EOL translation is text file by giving _____ argument in open ().

43 / 63

Which of the following statements are true regarding the opening modes of a file ?

44 / 63

Which of the following in not a valid mode to open a file ?

45 / 63

What will following code do?
f=open("data.txt")
L=f.readlines()
print(L[-1])

46 / 63

Serialisation process is also called picking.

47 / 63

Information stored on a storage device with a specific name is called a  ____ .

48 / 63

Which function is used to read all the the characters from a text file ?

49 / 63

To force Python to write the file buffer on to storage file, ______ method may be  used.

50 / 63

When you open a file for reading, if the file does not exist, an error occurs.

51 / 63

The file mode to open a binary file for writing as well reading is _____ .

52 / 63

When you open a file for appending, if the file exists, the exiting file is overwritten with the new file.

53 / 63

Which of the following represents mode of both writing and reading in binary format in files ?

54 / 63

What will following line of code do?

file1=open("data2.dat","rb+")

55 / 63

The default file-open mode is ______ mode.

56 / 63

Which of the following command is used to open a file "c: \pat.txt" in read-mode only ?

57 / 63

The relative paths for a file always remains the same ever after changing the directory.

58 / 63

________ is the default delimiter of csv files.

59 / 63

CSV files can be opened in Microsoft Excel.

60 / 63

The csv files are actually _____ files.

61 / 63

When you open a file for writing, if the file does not exist, an error occurs.

62 / 63

The file mode to open a csv file for reading as well writing is _____ .

63 / 63

Conversion of an object hierarchy in byte stream is called Serialization.



 

Spread the love
Lesson tags: Class 12 File Handling MCQ, Class 12 File Handling MCQ Quiz, python quiz for class 12
Back to: CBSE class 12 Computer Science notes
Spread the love