12 Cs Final Mock Objective Type July 2021
12 Cs Final Mock Objective Type July 2021
12 Cs Final Mock Objective Type July 2021
ASSESSMENT
SUBJECT- COMPUTER SCIENCE
CLASS- XII
Time: 45 MINUTES M.M.: 45
Instructions:
1. This question paper contains 45 Multiple-Choice Questions of 1 mark each.
2. All programming questions are to be answered using Python Language only
a) olleh
b) hello
c) h
d) o
a) dlrowolleh
b) hello
c) world
d) helloworld
8. What will be the output of the following Python code.
>>>max("what are you")
a) error
b) u
c) t
d) y
a) True
b) False
c) None
d) Error
14. To read two characters from a file object infile, we use ____________
a) infile.read(2)
b) infile.read()
c) infile.readline()
d) infile.readlines()
15. To read the entire contents of the file as a string from a file object infile, we use
a) infile.read(2)
b) infile.read()
c) infile.readline()
d) infile.readlines()
16. To read the next line of the file from a file object infile, we use ____________
a) infile.read(2)
b) infile.read()
c) infile.readline()
d) infile.readlines()
21. In file handling, what does this terms means “r, a”?
a) read, append
b) append, read
c) write, append
d) none of the mentioned
25. Which of the following are the modes of both writing and reading in binary format in file?
a) wb+
b) w
c) wb
d) w+
26. How do you get the current position within the file?
a) fp.seek()
b) fp.tell()
c) fp.loc
d) fp.pos
29. Ms. Suman is working on a binary file and wants to write data from a list to a binary file.
Consider list object as l1, binary file suman_list.dat, and file object as f. Which of the following can
be the correct statement for her?
a) f = open(‘sum_list’,’wb’); pickle.dump(l1,f)
b) f = open(‘sum_list’,’rb’); l1=pickle.dump(f)
c) f = open(‘sum_list’,’wb’); pickle.load(l1,f)
d) f = open(‘sum_list’,’rb’); l1=pickle.load(f)
30. Which option will be correct for reading file for suman from above question?
a) f = open(‘sum_list’,’wb’); pickle.dump(l1,f)
b) f = open(‘sum_list’,’rb’); l1=pickle.dump(f)
c) f = open(‘sum_list’,’wb’); pickle.load(l1,f)
d) f = open(‘sum_list’,’rb’); l1=pickle.load(f)
31. In which of the file mode existing data will be intact in binary file?
a) ab
b) a
c) w
d) wb
35. Which of the following module is required to import to work with CSV file
a) File
b) CSV
c) Pandas
d) Numpy
38. Anshuman wants to separate the values by a $ sign. Suggest to him a pair of function and
parameter to use it.
a) open,quotechar
b) writer,quotechar
c) open,delimiter
d) writer, delimiter
39. Which of the following commands would you use to start Python from the command
prompt?
a) run python
b) python
c) execute python
d) go python
40. Select the statement(s) correctly explain the usage of seek() method?
a. tell the current position within the file.
b. indicate that the next read or write occurs from that position in a file.
c. determine if you can move the file position or not.
d. move the current file position to a different location at a defined offset
41. Which of the following functions do you use to write data in the binary format?
a) write
b) Load
c) dump
d) send
a) //
b) ?
c) <
d) And
43. Select from the following the type of tokens for ' if ':
a) KEYWORD
b) OPERATOR
c) IDENTIFIER
d) NONE OF THE ABOVE
44. Iteration statements(loop) are used to execute a block of statements as long as the condition is
satisfied.
a) True
b) False
a) False
b) True
c) 5
d) 10