Class 12 Computer Science File Handling in Python MCQs Set 1

Python File Handling



File Handling in Python MCQ’s Set – 1

Multiple Choice Questions

1. Python program written in script mode with a _________ extension.

a) .python

b) .pyth

c) .py

d) .pyt

Answer : c) .py

2. A ______ is named location on a secondary storage media where data are permanently stored for later access.

a) file

b) disk

c) memory

d) None of these

Answer : a) file

3. A ______ in itself is a bunch of bytes stores on some storage device like hard-disk, thumb-drive etc.

a) file

b) data

c) information

d) None of these

Answer : a) file

4. The __________ are the files that store data pertaining to a specific application, for later use.

a) files

b) data files

c) dump files

d) None of these

Answer : b) data files

5. There are mainly ________ types of data files.

a) 2

b) 3

c) 4

d) None of these

Answer : a) 2

6. Data files can be stored as ____________

a) Text files

b) Binary files

c) Both (a) and (b)

d) None of these

Answer : c) Both (a) and (b)

7. Computers store every file as a collection of ______ and ________.

a) data, information

b) 0’s , 1’s

c) text, numbers

d) None of these

Answer : b) 0’s and 1’s

8. A _________ stores information in the form of a stream of ASCII or Unicode characters i.e. human redable.

a) Text files

b) Binary files

c) Both (a) and (b)

d) None of these

Answer : a) Text files

9. A text files can be opened by __________.

a) notepad

b) python idle

c) ms word

d) All of the above

Answer : d) All of the above

10. In text files, each line of text is terminated with a special character known as __________.

a) Delimiter

b) Terminator

c) EOL

d) All of the above

Answer : c) EOL

11. EOL stands for __________.

a) End of Language

b) End of Line

c) Exit of Line

d) None of these

Answer : b) End of Line

12. In Python, the EOL character is represented by _______

a) new line character ‘\n’

b) carriage return and newline ‘\r\n’

c) Both(a) and (b)

d) None of these

Answer : c) Both of (a) and (b)

13. The text files can be of ___________ types.

a) 1

b) 2

c) 3

d) None of these

Answer : b) 2

14. Regular text files have a file extension ________.

a) .txt

b) .sys

c) .exe

d) None of these

Answer : a) .txt

15. Which of the following are examples of text files.

a) .txt

b) .py

c) .csv

d) All of these

Answer : d) All of these

16. Contents in a text file are usually separated by ___________ value.

a) whitespace

b) comma (,)

c) tab (\t)

d) All of these

Answer : d) All of these

17. When a tab character is used to separate the values stored in a files. These files are know as ______________.

a) Tabbed Text Files

b) Tab Separated Values (TSV) Files

c) Tabs Separated Values (TSV) Files

d) All of these

Answer : b) Tab Separated Values (TSV) Files

18. When comma is used to separate the values stored in a files. These files are know as ______________.

a) Common Values Files

b) Command Separated (CSV) Files

c) Comma Separated Values (CSV) Files

d) All of these

Answer : c) Comma Separated Values (CSV) Files

19. Which of the following is a valid example of Regular Text File content?

a) Best Website for Computer Science Term 1 Examination is mycstutorial.in.

b) Best → Website → for → Computer → Science → Term 1 → Examination → is → mycstutorial.in.

c) Best, Website, for, Computer, Science, Term 1, Examination, is, mycstutorial.in.

d) All of these

Answer : a) Best Website for Computer Science Term 1 Examination is mycstutorial.in .

20. Which of the following is a valid example of TSV file content?

a) Best Website for Computer Science Term 1 Examination is mycstutorial.in.

b) Best → Website → for → Computer → Science → Term 1 → Examination → is → mycstutorial.in.

c) Best, Website, for, Computer, Science, Term 1, Examination, is, mycstutorial.in.

d) All of these

Answer : b) Best → Website → for → Computer → Science → Term 1 → Examination → is → mycstutorial.in.


Thanks for visiting www.mycstutorial.in.

Python File Handling (MCQ’s)



Python Revision Tour – Multiple Choice Questions (MCQ’s)



Python Functions – Working with Functions (MCQ’s)



You cannot copy content of this page

Scroll to Top