0% found this document useful (0 votes)
6K views7 pages

Kendriya Vidyalaya Sangathan Jaipur Region: Sample Question Paper (Term-I)

This document contains a sample question paper for Class 12 Computer Science with 3 sections - A, B and C. Section A has 25 questions and the student has to attempt 20. Section B has 24 questions and the student has to attempt 20. Section C has 5 questions and the student has to attempt all 5. All questions carry equal marks of 0.77. The document provides instructions on the paper format and questions from sections A and B.

Uploaded by

Samira Farooqui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6K views7 pages

Kendriya Vidyalaya Sangathan Jaipur Region: Sample Question Paper (Term-I)

This document contains a sample question paper for Class 12 Computer Science with 3 sections - A, B and C. Section A has 25 questions and the student has to attempt 20. Section B has 24 questions and the student has to attempt 20. Section C has 5 questions and the student has to attempt all 5. All questions carry equal marks of 0.77. The document provides instructions on the paper format and questions from sections A and B.

Uploaded by

Samira Farooqui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

KENDRIYA VIDYALAYA SANGATHAN JAIPUR REGION

Sample Question Paper (Term-I)


Class : XII Time Allowed : 90 Minutes
Subject : (083) Computer Science Maximum Marks: 35

General instructions:
The paper is divided into 3 Sections- A, B and C.
Section A, consists of Question 1 to 25 and student need to attempt 20 questions.
Section B, consists of Question number 26 to 49 and student need to attempt 20 questions.
Section C, consists of Question number 50 to 55 and student need to attempt 5 questions.
All questions carry equal marks (0.77 mark per question).

Section – A
Section A consists of 25 questions, attempt any 20 questions
1. Choose odd one out : - A. 1
A. except B. 2
B. with C. 3
C. Import D. 4
D. else 6. To read the remaining lines of the file from a file
object infile, we use _
2. What will be the output of the following code A. infile.read(2)
segment? B. infile.read()
l=['A','a','Aa','aA'] C. infile.readline()
print(max(l)) D. infile.readlines()
A. 'aA'
B. 'A', 7. Which is not a string out of the followings: -
C. 'a' A. ‘55’
D. 'Aa' B. “X.Y”
C. “Hello 1”
3. Which one of the followings is logical operator: - D. None of the above
A. exponent
B. modulus 8. Name the module which will be needed to use
C. and the function max( ) : -
D. floor division A. math
B. random
4. Which of the following statement(s) is/are true? C. stat
A. When you open a file for reading, if the file D. No module required
does not exist, an error occurs
B. When you open a file for writing, if the file 9. Which command we can use to remove
does not exist, a new file is created string “hello” from list1, Given, list1=[“hello”]
C. When you open a file for writing, if the file A. list1.remove(“hello”)
exists, the existing file is overwritten with the B. list1.pop(list1.index('hello'))
new file C. Both a & b
D. All of the mentioned D. None of these

5. What is the length of the given tuple? 10. A variable declared/defined outside a specific
t1=(1,2,(3,4,5)) function is known as: -

1 | KVS – Regional Office, JAIPUR | Session 2021-22


A. Local variable D. tell( )
B. Specific variable
C. Global Variable 18. Number of lines required for one record in a csv
D. None of the above file:
11. Which of the following is not a function of tuple? A. It depends on the size of the record
A. update( ) B. 2
B. index( ) C. 1
C. len( ) D. None of these
D. count( )
12. ………………… function is used to know the 19. Which of the following will raise an error if the
position of file pointer in a file: - given key is not found in the dictionary ?
A. get_pos() A. del statement
B. tell() B. pop()
C. seek() C. getitem()
D. position() D. all of these

13. What is the delimiter in following csv file': 20. In file handling, what does this term means “r,
f=open(‘abc.csv’,delimiter=’\n’): a”?
A. Tab space A. read, append
B. Comma B. append, read
C. New Line Character C. write, append
D. Blank Space D. none of the mentioned

14. Write the output of the following: 21. Which of the following statement is true:
a=(1, 2, 3, 2, 3, 4, 5) A. csv is not available in alphanumeric
print(min(a) + max(a) + a.count(2)) B. csv file is faster to handle
A. 13 C. csv file is smaller in size
B. 6 D. csv is used for large data transfer
C. 8
D. Error 22. What is the meaning of ‘r+b’ in binary mode?
A. write and read
15. Which of the following content can be B. read only
represented by a binary file? C. read and write
A. image D. write only
B. video
C. audio 23. The read() method returns
A. String
D. All of the above
B. A List of integers
C. A list of characters
16. In which of the format the end of the line is
D. A List of Lines
denoted by ‘\n’ and ‘\r’?
A. Binary
24. In windows csv file cannot be opened with:
B. Text
A. Microsoft Excel
C. Both
B. Microsoft word
D. None of above
C. Acrobat Reader
D. Notepad
17. Which method is used for writing data in binary
file?
25. Delimiter in csv file may be changed.
A. dump( )
A. True B. False
B. load()
C. Both True and False D. None
C. seek( )

2 | KVS – Regional Office, JAIPUR | Session 2021-22


Section – B
Section B consists of 24 questions, attempt any 20 questions.

26. Write the output of the following. print(i, end=' ')


A = tuple(“Python”) A. {0:'zero',1:'one',2:'two',3:'three'}
print(A) B. 'zero','one','two','three'
A. (python) C. Error
B. (“Python”) D. 0 1 2 3
C. (‘P’ , ‘y’ , ‘t’ , ‘h’ , ‘o’ , ‘n’)
D. None of the above 31. Which statement does not show any error after
execution? Given L=[1,2,3,4]
27.Assume the content of text file, 'student.txt' is: A. print(L+L)
Ramesh is student B. print(L*L)
Radha is girl C. print(L-L)
KVS D. All of the mentioned
Jaipur
What will be the data type of data_rec?
myfile = open("student.txt") 32.What will be the output of following code:
data_rec = myfile.readlines() import pickle
myfile.close() Emp_Names=[‘Umesh’, ‘Sapan’, ‘Mukesh’, ‘Harish’, ‘Naval’]
A. string list1=[ ]
B. list for i in range(-1,-6,-2):
C. tuple list1.append(Emp_Names[i])
D. dictionary with open (‘emp.dat’, ‘wb’) as fout:
pickle.dump(list1,fout)
28. which command we use cane use To remove with open (‘emp.dat’, ‘rb’) as fin:
string “hello” from list1, newlist=pickle.load(fin)
Given, list1=[“hello”] print(newlist)
A. list1.remove(“hello”)
B. list1.pop(list1.index('hello')) A. [‘Umesh’, ‘Sapan’, ‘Mukesh’, ‘Harish’, ‘Naval’]
C. both a & b B. [‘Umesh’, ‘Sapan’, ‘Mukesh’]
D. none of these C. [‘Naval’, ‘Mukesh’, ‘Umesh’]
D. [‘Naval’, ‘Umesh’, ‘Mukesh’]
29. Which of the following is not a declaration of the
dictionary?
A. {1: ‘A’, 2: ‘B’}
B. dict([[1,”A”],[2,”B”]])
C. {1,”A”,2”B”}
D. { }
33. Which statement(s) are true about the pickle
module in data file handling?
30. Write the output of- A. It is used for serialization and deserialization of
d={0:'zero',1:'one',2:'two',3:'three'} any python object structure
for i in d: B. It provides two methods dump( ) and load( )

3 | KVS – Regional Office, JAIPUR | Session 2021-22


C. Both (a) and (b) global val
D. It provides two methods seek( ) and tell( ) val = 50
if N%14==0:
val = val + N
34. Identify correct output else:
def fun3(a,b,c): val = val - N
return a+1,b+2,c+3 print(val, end="@")
t=fun3(10,20,30) display(40)
print(t) print(val)
A. 11,22,33 a) 100@10
B. 11 22 33 b) 50@5
C. (11, 22, 33) c) 5@50
D. (11 22 33) d) 100@10@

35. Evaluate the expression given below if A = 16 38. What will be the possible output of the following
and B = 15. code?
import random
A % B // A List=[’Delhi’,’Mumbai’,’Chennai’,’Kolkata’]
for y in range(4):
A. 0.0 x=random.randint(1,3)
B. 0 print(List[x],end=’#’)
C. 1.0 A.Delhi#Mumbai#Chennai#Kolkata#
D. 1 B. Mumbai#Chennai#Kolkata#Mumbai#
C. Mumbai# Mumbai #Mumbai # Delhi#
36. What will be the output of the following python D.Mumbai# Mumbai #Chennai # Mumbai
code:
def A_func (x=10, y=20): 39. Predict the output of the following code (A)
x =x+1 def fun3(num1,num2):
y=y-2 for x in range(num1,num2):
return (x+y) if x%4==0:
print(A_func(5),A_func()) print(x,end=’ ‘)
A. 24,29 fun3(10,20)
B. 15,20 a. 10 12 16 20
C. 20,30 b. 12 16
D. 25,30 c. 12 16 20
d. 16

37. What will be the output of the following 40. Considering the following function/method in
python code: python which read lines from a text file
val = 100 “INDIA.TXT”, to find and display the occurrence of
def display(N):

4 | KVS – Regional Office, JAIPUR | Session 2021-22


the word “India”. Find the missing statement in i like computer.
following code: What will be the output of the following code?
def countword(): myfile = open("stu.txt")
f=open("INDIA.TXT", 'r') str = myfile.readlines()
count=0 print(str)
data=___________ myfile.close()
word=data.split() (A) read first line
for i in word: (B) read entire file
if i.lower()=='india': (C) read second file
count=count+1 (D) None of above
print("no of words=",count)
f.close() 43. The file “new.txt” contains the following
(A) f.read() content:
(B) f.readline() my poem
(C) f.readlines Humpty Dumpty sat on a wall
(D) f.write() Humpty Dumpty had a great fall
41. Consider the code given below and Identify All the king's horses and all the king's men
Which message will never be printed Couldn't put Humpty together again
def prog(name): Poem is good but do not like
for x in name: Considering the above file, what output will be
if x.isalpha():
produced by the following code?
print(“alphabet”)
elif x.isdigit(): f=open("new.txt",'r')
print(“digit”) a=f.readline()
elif x.isupper(): b=f.read(4)
print(“upper”) c=f.readline()
else: d=f.readline()
print(“all the best”) print(c)
prog(“vishal123@gmail.com”)
f.close()
A. alphabet (A) a great fall
B. digit (B) ty Dumpty sat on a wall
C. upper (C) Dumpty sat on a
D. all the best (D) Humpty together again
44. Identify the Output for the below code:
z=5
def A_func (x=10, y=20):
x =x+z
y=y-z
return (x+y)
print(A_func(5),A_func())
A) 20 25
B) 25 30
C) 10 20
42. You have given a file 'stu.txt' D) 15 25
my kv is best in the world. i am a best student.

5 | KVS – Regional Office, JAIPUR | Session 2021-22


C. F=open(r"d:\CS\Myfile.txt","r")
45. The readlines() method returns ____________ D. F=open("d:\Myfolder\\Myfile.txt","w")
A. a string
B. a list of lines
C. list of single characters 48. Assume the content of text file, 'student.txt' is:
D. a list of integers Ramesh is student
Radha is girl
KVS
46. Read the code given below and answer the Jaipur
question: What will be the data type of data_rec?
f=open(“sample.txt”,’w’) myfile = open("student.txt")
f.write(“Morning”) data_rec = myfile.read()
f.close() myfile.close()
If the file contains “Good” before execution, what A. string
will be the contents of the file after execution of this B. list
code? C. tuple
A. Good Morning D. dictionary
B. Good
C. Morning
D. None of these 49. Which of the following statement will return an
error? T1 is a tuple.
47. To open a file Myfile.txt ,which is stored in D A. T1 + (23)
Drive under folder CS, for READING , we can use B. T1 + [3]
A. F=open("d:\CS\Myfile.txt","rw") C. Both of the above
B. F=open(file="d:\CS\Myfile.txt","wr") D. None of the above

6 | KVS – Regional Office, JAIPUR | Session 2021-22


Section – C
Section C consists of 06 questions, attempt any 05 questions.

Bhavesh is learning to work with Binary files in B. w


Python using a process known as Pickling/Un- C. wb
pickling. His Computer Science teacher given him D. a
the following incomplete code, which is creating a 52. What should be written in Statement-3 to write
Binary file namely Record.dat and then opens, reads data onto the file.
and displays the content of this created file. A. dump()
import ___________ #Statement-1 B. write()
L1=list() C. pickle.dump()
for i in range(4): D. writeline()
L.append(i+i)
f1=open(“Record.dat”, _____) #Statement-2 53. Which function to be used in Statement-4 to
___________(L1,f1) #Statement-3 read the data from the file.
f1.close() A. load()
f2=open(“Record.dat”, “rb” ) B. readline()
L2=____________(f2) #Statement-4 C. readlines()
f2.____________ #Statement-5 D. pickle.load()
print(L2) #Statement-6
54. Which function to be used in Statement-5 to
50. Which module should be imported in close the file Record.dat
Statement-1. A. dump()
A. pickle B. load()
B. csv C. exit()
C. file D. close()
D. text
55. The output after executing Statement-6 will be –
51. Which file mode to be passed to write data in A. 0 2 4 6
file in Statement-2. B. {0, 2, 4, 6}
C. [0, 2, 4, 6
A. w+ D. (0, 2, 4, 6)

0-O-o- Best of Luck –o-O-0

7 | KVS – Regional Office, JAIPUR | Session 2021-22

You might also like