12 CS HW
12 CS HW
1 CUTTACK
XII Computer Science Summer Holiday HW Session: 2025-26
SECTION:A
Q Question
No.
1 State True or False
“Tuple is datatype in Python which contain data in key-value pair.”
2 Which of the following is not a keyword?
(A) eval (B) assert
(C) nonlocal (D) pass
3 Given the following dictionaries
dict_student = {"rno" : "53", "name" : ‘Rajveer Singh’}
dict_marks = {"Accts" : 87, "English" : 65}
Which statement will merge the contents of both dictionaries?
(A) dict_student + dict_marks (B) dict_student.add(dict_marks)
(C) dict_student.merge(dict_marks) (D) dict_student.update(dict_marks)
4 Consider the given expression:
not ((True and False) or True)
Which of the following will be correct output if the given expression is evaluated?
(A) True (B) False
(C) NONE (D) NULL
5 Select the correct output of the code:
>>> s='mail2kv@kvsangathan.kvs.in'
>>> s=s.split('kv')
>>> op = s[0] + "@kv" + s[2]
>>> print(op)
(A) mail2@kvsangathan (B) mail2@sangathan.
(C) mail2@kvsangathan. (D) mail2kvsangathan.
6 Which of the following statement(s) would give an error after executing the following code?
D={'rno':32,'name':'Ms Archana','subject':['hindi','english','cs'],'marks':(85,75,89)} #S1
print(D) #S2
D['subject'][2]='IP' #S3
D['marks'][2]=80 #S4
print(D) #S5
(A) S1 (B) S3
(C) S4 (D) S3 and S4
7 What will the following expression be evaluated to in Python?
print ( round (100.0 / 4 + (3 + 2.55) , 1 ) )
(A) 30.0 (B) 30.55
(C) 30.6 (D) 31
8 (A) Given is a Python string declaration:
message='FirstPreBoardExam@2022-23'
Write the output of: print(message[ : : -3].upper())
for c in range(1,6,2):
times = times + c
alpha = alpha + data [c-1] + "@"
add = add + data[c]
print (times, add, alpha)
10 Predict the output of the Python code given below:
L=[1,2,3,4,5]
Lst=[]
for i in range(len(L)):
if i%2==1:
t=(L[i],L[i]**2)
Lst.append(t)
print(Lst)
11 Find the invalid identifier from the following
a) Marks@12 b) string_12 c)_bonus d)First_Name
12 Identify the valid declaration of Rec:
Rec=(1,‟Ashoka",50000)
a) List b) Tuple c)String d) Dictionary
13 Suppose a tuple Tup is declared as Tup = (12, 15, 63, 80) which of the following is incorrect?
a) print(Tup[1]) b) Tup[2] = 90
c) print(min(Tup)) d) print(len(Tup))
14 The correct output of the given expression is:
True and not False or False
(a) False (b) True (c) None (d) Null
t1=(2,3,4,5,6)
print(t1.index(4))
output is
(a) 4 (b) 5 (c) 6 (d) 2
15 Which of the following statement(s) would give an error after executing the following code?
x= int("Enter the Value of x:")) #Statement 1
for y in range[0,21]: #Statement 2
if x==y: #Statement 3
print (x+y) #Statement 4
else: #Statement 5
print (x-y) # Statement 6
(a) Statement 4 (b) Statement 5
(c) Statement 4 & 6 (d) Statement 1 & 2
16 (a) Given is a Python string declaration:
str="Kendriya Vidyalaya Sangathan"
Write the output of: print(str[9:17])
(b) Write the output of the code given below:
lst1 = [10, 15, 20, 25, 30]
lst1.insert( 3, 4)
lst1.insert( 2, 3)
print (lst1[-5])
17 Evaluate the following Python expression
print(12*(3%4)//2+6)
(a)12 (b)24 (c) 10 (d) 14
18 Fill in the Blank
The explicit conversion of an operand to a specific type is called _____
(a)Type casting (b) coercion (c) translation (d) None of these
19 Which of the following is not a core data type in Python?
(a)Lists (b) Dictionaries (c)Tuple (d) Class
20 What will the following code do?
dict={"Exam":"AISSCE", "Year":2022}
dict.update({"Year”:2023} )
a. It will create new dictionary dict={” Year”:2023}and old dictionary will be deleted
b. It will throw an error and dictionary cannot updated
c. It will make the content of dictionary as dict={"Exam":"AISSCE", "Year":2023}
d. It will throw an error and dictionary and do nothing
21 What will be the value of the expression : 14+13%15
22 Which of the following statement(s) would give an error after executing the following code?
S="Welcome to class XII" # Statement 1
print(S) # Statement 2
S="Thank you" # Statement 3
S[0]= '@' # Statement 4
S=S+"Thank you" # Statement 5
SECTION:C
Exception Handling
1. When are the following built‐in exceptions raised? Give examples to support your answers.
a) ImportError
b) IOError
c) NameError
d) ZeroDivisionError
2. State True or False
The try block in Python can contain multiple excepts to handle different types of exceptions.
3. How many except statements can a try‐except block have?
a) zero b) one c) more than one d) more than zero
4. Write a Python program to handle a ZeroDivisionError exception when dividing a number by zero.
SECTION:D
Submit the project synopsis (Hard Copy)which include
i.Objective of the project
ii.Need and scope of the project
iii.Requirement(Software and Hardware)
iv.Flow chart and Data flow Diagram
v.Database Design
vi.Coding