Python Data File Handling & Data Structures MCQs with Answers for Class 12 CBSE
Hi Students i have given the Important MCQ’s with Answers of Data File Handling and Data Structures full pdf for Class 12 CBSE, for demo i have given few questions here and you can download Data File Handling and Data Structures full pdf | Objective Type Questions using given link below.
MCQ-DATA FILE HANDLING: CLASS XII
1. To open a file c:\scores.txt for reading, we use
a) infile = open(“c:\scores.txt”, “r”)
b) infile = open(“c:\\scores.txt”, “r”)
c) infile = open(file = “c:\scores.txt”, “r”)
d) infile = open(file = “c:\\scores.txt”, “r”)
- Answer: b
- Explanation: Execute help(open) to get more details.
2. To open a file c:\scores.txt for writing, we use
a) outfile = open(“c:\scores.txt”, “w”)
b) outfile = open(“c:\\scores.txt”, “w”)
c) outfile = open(file = “c:\scores.txt”, “w”)
d) outfile = open(file = “c:\\scores.txt”, “w”)
- Answer: b
- Explanation: w is used to indicate that file is to be written to.
3. To open a file c:\scores.txt for appending data, we use
a) outfile = open(“c:\\scores.txt”, “a”)
b) outfile = open(“c:\\scores.txt”, “rw”)
c) outfile = open(file = “c:\scores.txt”, “w”)
d) outfile = open(file = “c:\\scores.txt”, “w”)
- Remaining questions download link given below
MCQ-DATA STRUCTURES: CLASS XII
- Answer: b
- Explanation: None.
- Answer: d
- Explanation: None.
- Answer: a
- Explanation: None.
- Answer: a
- Explanation: None.
- Answer : d
- Explanation: None.