Professional Documents
Culture Documents
The Qualifier 1 (Xii - CS)
The Qualifier 1 (Xii - CS)
if (value% mul==0):
print(value*mul)
else:
print(value+mul)
(a) 13 (b) 13
14 13
15 13
(c) 3 (d) Error
10
13
a=3
while (a<12) :
print(a, end= ‘ ’)
a = a + 2
(a) 3 4 5 6 7 8 9 10 11 12 (b) 3 4 5 6 7 8 9 10 11
(c) 3 5 7 9 11 (d) 5 7 9 11
CBSE Sample Questions Computer Science Class XII
print(2)
(a) 1 (b) 1 (c) 1 (d) 1
3 2 3 2
5 3 5 3
2 5
2
14. What will be the output of the following Python code?
for i in range(8):
if i = = 4:
break
else:
print(i+3)
else:
print(1)
(a) 2 (b) 3 (c) 3 (d) Error
4 4 4
6 5 5
8 6 6
1
15. What will be the output of the following Python code snippet?
x = ‘ARIHANT’
for i in range(len(x)):
x[i].lower()
print(x)
(a) ARIHANT (b) arihant (c) Arihant (d) Error
8. Which of the following option will not result in an error when performed on tuple in
Python, where tup1=(5, 6, 8, 9)?
(a) tup1[1]=12 (b) tup1.append(2) (c) tup=tup1+tup1 (d) tup1.sort()
9. dic1={“A”:15,“B”:16,“C”:17}
print(dic1[1])
What will be the output of above Python code?
(a) B (b) 16 (c) {“B”:16} (d) Error
10. What will be the output of below Python code?
tup1=(1, 2, 3)
tup=tup1*2
print(tup)
(a) (2,4,6) (b) (1,2,3,1,2,3) (c) (1,1,2,2,3,3) (d) Error
11. Which of the following two Python codes will give same output?
>>> tup1=(1, 2, 3, 4, 5)
(i) print(tup1[:-1]) (ii) print(tup1[0:5])
(iii) print(tup1[0:4]) (iv) print(tup1[-4:])
(a) i, ii (b) ii, iv
(c) ii, v (d) i, iii
12. What will be the output of the following Python code?
x=[1, 3, 6, [18]]
y=list(x)
x[3][0]=15
x[1]=12
print(y)
THE QUALIFIERS
for i in num:
sum += num[i]
print(len(num) + sum)
(a) 54 (b) 38
(c) 33 (d) 59
14. What will be the output of following Python code?
list1=[1,2,3,4,5]
str1=“6”
for i in list1:str1=str1+i
print(str1)
(a) 654321 (b) 123456
(c) 123645 (d) Error
15. What will be the output of following Python code?
dict1={“A”:15,“B”:23,“C”:21}
str1=“ ”
for i in dict1:
str1=str1+str(dict1[i])+“ ”
str2=str1[:−1]
print(str2[::−1])
(a) 12 32 51 (b) 12 32 15 (c) 32 21 15 (d) Error
***************************************************************************************************************************** ******