aglasem.com
Home Schools Admission Career Mock Test PDF Docs Playground
ClassChoose class
StateSelect state

CBSE Class 12 Question Paper 2026 Computer Science

Download the CBSE Class 12 Question Paper 2026 Computer Science PDF for free at AglaSem. Solving this previous year question paper helps you understand the real CBSE Class 12 exam pattern, question types, difficulty level and marking scheme, and reveals important repeated topics — practise it to build speed, accuracy and exam confidence.
CBSE Class 12 Question Paper 2026 Computer Science - Page 1 of 33

Finished viewing? Save it for later —

Download CBSE Class 12 Question Paper 2026 Computer Science (PDF · 33 pages)
Downloaded 167 times

About CBSE Class 12 Question Paper 2026 Computer Science

CBSE Class 12 Question Paper 2026 Computer Science is available here for free download. Published by CBSE for Class 12, this question paper can be viewed online or downloaded as a PDF (33 pages). Candidates preparing for Class 12 can use CBSE Class 12 Question Paper 2026 Computer Science to understand the exam pattern, the type of questions asked, and the overall difficulty level.

Frequently Asked Questions

How can I download CBSE Class 12 Question Paper 2026 Computer Science?

Open this page and click the Download button to save CBSE Class 12 Question Paper 2026 Computer Science as a PDF. It is completely free on AglaSem Docs.

Is CBSE Class 12 Question Paper 2026 Computer Science free to download?

Yes. CBSE Class 12 Question Paper 2026 Computer Science can be viewed online and downloaded as a PDF free of cost on AglaSem Docs.

How many pages does CBSE Class 12 Question Paper 2026 Computer Science have?

CBSE Class 12 Question Paper 2026 Computer Science contains 33 pages, which you can read online or download together as a single PDF.

Where can I find more Class 12 study material?

You can find more Class 12 question papers, sample papers, syllabus, and answer keys on AglaSem Docs.

CBSE Class 12 Question Paper 2026 Computer Science – Text

Read the full text of this question paper below — useful to quickly search, copy and reference the content online without downloading the PDF.

📄 View text version (33 pages)

Page 1

FOR CBSE CLASS 12 EXAM PREPARATION

CBSE Class 12 2026
Question Paper ·
Computer Science
EXAM YEAR TYPE SUBJECT

CBSE Class 12 2026 Question Paper Computer Science

Notes · Sample Papers · Previous Year Papers · Mock Tests

Page 2

m
m .co

m .co s e m
se g l a
Series : QR1SP a SET-4
- 
Q.P. Code 91
 .  -   - 
Roll No. -    
Candidates must write the Q.P. Code
m
.co
on the title page of the answer-book.
{} m
.co s e m
 :
s em NOTE :
l a
a
(I) gl     -    ag
(I) Please check that this question
a
32   paper contains 32 printed pages.

(II) -        - (II) Q.P. Code given on the right hand
   -  -  side of the question paper should
be written on the title page of the
 
answer-book by the candidate.
(III)       -  37    (III) Please check that this question
m
paper contains 37 questions.

m (IV) Please .co
(IV)         ,
-       a
e
s
write down the serial
number of the question in the
l 
   ag answer-book at the given place
before attempting it.
(V)  -     15    (V) 15 minute time has been allotted
    -     to read this question paper. The
question paper will be distributed
10.15     10.15   10.30
at 10.15 a.m. From 10.15 a.m. to
    -     10.30 a.m., the candidates will
    -     read the question paper only and
  m on the
will not write any answer

om
answer-book during this period.
. co
. c e m
e m l as
s   g
g la a
a COMPUTER SCIENCE
  : 3    : 70
Time allowed : 3 hours Maximum Marks : 70

91* 2334 1 * Page P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 1 of 32

Page 3

  :
(i)  -  37   
(ii)                    
   
(iii)  -  5  , , ,        
(iv)  -   21  (1  21)       1    
(v)  -   7  (22  28)       2    
(vi)  -   3  (29  31)       3    
(vii)  -   4  (32  35)       4    
(viii)  -   2  (36  37)       5    
(ix)       Python Language     
(x)   (Multiple Choice Questions)       text  
  

 –  (21  1 = 21)

1.     (true)    (false) :
 (Python)  74  data type 74.0  data type      1

2.    (Code Snippet)  output    1
s = "the Truth"
print(s.capitalize())
(A) The truth (B) THE TRUTH
(C) The Truth (D) the Truth

3.  (Python)        True  (evaluate)  ? 1
(A) 2>3 and 2<3 (B) 3>1 and 2
(C) 3>1 and 3>2 (D) 3>1 and 3<2

91* 2 * Page

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 2 of 32

Page 4

m
m .co

m .co s e m
se g l a
General Instructions : a
(i) This question paper contains 37 questions.
(ii) All questions are compulsory. However, internal choices have been
provided in some questions. Attempt only one of the choices in such
questions.
(iii) The paper is divided into 5 Sections – A, B, C, D and E.
(iv) Section A consists of 21 questions (1 to 21). Each question carries
m
1 mark.
m .co
(v)
.co
Section B consists of 7 questions (22 to 28). Each question carries
m s e m
s e
2 marks.
g l a
l a
(vi) Section
a
C consists of 3 questions (29 to 31). Each question carries
ag3 marks.
(vii) Section D consists of 4 questions (32 to 35). Each question carries
4 marks.
(viii) Section E consists of 2 questions (36 & 37). Each question carries
5 marks.
(ix) All programming questions are to be answered using Python Language
only.
m
.co
(x) In case of MCQs, text of the correct answer should also be written.

e m
las
SECTION – A (21  1 = 21)

ag
1. State True or False : 1
In Python, data type of 74 is same as the data type of 74.0.

2. Identify the output of the following code snippet : 1
s = "the Truth"
print(s.capitalize()) m
m(A) The truth
c. o (C) The Truth
(B) THE TRUTH
m.co
m (D) the Truth s e
s e g l a
g la a
a 3. Which of the following expressions in Python evaluates to True ? 1
(A) 2>3 and 2<3 (B) 3>1 and 2
(C) 3>1 and 3>2 (D) 3>1 and 3<2

91* 3 * Page P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 3 of 32

Page 5

4.     output   ? 1

s='War and Peace by Leo Tolstoy'
print(s.partition("by"))
(A) ('War and Peace ', 'by', ' Leo Tolstoy')

(B) ['War and Peace ', 'by', ' Leo Tolstoy']

(C) ('War and Peace ', ' Leo Tolstoy')

(D) ['War and Peace ', ' Leo Tolstoy']

5.  statement  output   ? 1

print("PythonProgram"[–1:2:–2])

6.     output   ? 1

t = tuple('tuple')
t2 = t[2],
t += t2
print(t)
(A) ('tuple')

(B) ('tuple','p')

(C) ('t', 'u', 'p', 'l', 'e', 'p')

(D) ('t', 'u', 'p', 'l', 'e')

7.    (dictionaries)            ? 1

(A)    (sequence)     
(B)     elements   key    
(C)     elements   (value)      
(D)  element  key  value     

91* 4 * Page

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 4 of 32

Page 6

m
m .co

m .co s e m
se g l a
4. What is the output of the following code snippet a
? 1
s='War and Peace by Leo Tolstoy'
print(s.partition("by"))

(A) ('War and Peace ', 'by', ' Leo Tolstoy')

(B) ['War and Peace ', 'by', ' Leo Tolstoy']
m
(C) ('War and Peace ', ' Leo Tolstoy')
m .co
(D) .co
['War and Peace ', ' Leo Tolstoy']
s e m
s em l a
g l a ag
5. a will be the output of the following statement ?
What 1
print("PythonProgram"[–1:2:–2])

6. What will be the output of the following code snippet ? 1
t = tuple('tuple')
t2 = t[2], m
t += t2
m .co
s e
print(t)
g la
(A) ('tuple') a
(B) ('tuple','p')

(C) ('t', 'u', 'p', 'l', 'e', 'p')

(D) ('t', 'u', 'p', 'l', 'e')

m
7.
c. o
m Which of the following statements is true about dictionaries in Python ?
m.co 1

m (A) A dictionary is an example of sequence datatype. s e
s e g l a
g la a
(B) A dictionary cannot have two elements with same key.
a (C) A dictionary cannot have two elements with same value.

(D) The key and value of an element cannot be the same.

91* 5 * Page P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 5 of 32

Page 7

8.  L   (List) ,  6 elements ,      
(statement) exception raise  ? 1
(A) L.pop(1) (B) L.pop(6)
(C) L.insert(1,6) (D) L.insert(6,1)

9.    output   ? 1
def f1(a,b=1):
print(a+b,end='–')
c=f1(1,2)
print(c,sep='*')
(A) 3–2 (B) 3–2*
(C) 3–None (D) 3*None–

10.    statement    : 1
f1 = open("pqr.dat","________")
Read only mode            mode  ?
(A) a (B) rb
(C) r+ (D) rb+

11.  statement  (True)    (False),  : 1
 (Python) , try……except……finally statement    logical
errors  handle     

12.  table   candidate keys ,    primary key        
table     (alternate keys)  ? 1
(A) 0 (B) 1
(C) 2 (D) 3

13.      SQL    (existing relation)  
(degree)    ? 1
(A) DROP TABLE (B) ALTER TABLE
(C) UPDATE…SET (D) DELETE

91* 6 * Page

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 6 of 32

Page 8

m
m .co

m .co s em
se g la
8. If L is a list with 6 elements, then which of theafollowing statements will
raise an exception ? 1
(A) L.pop(1) (B) L.pop(6)
(C) L.insert(1,6) (D) L.insert(6,1)

9. What will be the output of the following code ? 1
m
.co
def f1(a,b=1):
o m
print(a+b,end='–')
m
c=f1(1,2)m.
c s e
s e l a
l a
print(c,sep='*')
(A)ag3–2 (B) 3–2*
ag
(C) 3–None (D) 3*None–

10. Consider the statement given below : 1
f1 = open("pqr.dat","________")
Which of the following is the correct file mode to open the file in read only
mode ?
m
(A) a
.co
(B) rb
(C) r+
s em(D) rb+
g la
11. State whether the following a
statement is True or False : 1
In Python, Logical errors can be handled using try……except……finally
statement.

12. A table has two candidate keys, one of which is chosen as the primary key.
How many alternate keys does this table have ? 1
m
.co
(A) 0 (B) 1
m
c. o (C) 2 s e m (D) 3

s em 13. Which of the following SQL command can change gthela degree of the
g la a
a existing relation ? 1
(A) DROP TABLE (B) ALTER TABLE
(C) UPDATE…SET (D) DELETE

91* 7 * Page P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 7 of 32

Page 9

14.  query  output   ? 1

SELECT MACHINE_ID, MACHINE_NAME FROM INVENTORY
WHERE QUANTITY <= 100;

(A)  (INVENTORY)  (table)      (quantity) 100
   
(B)  (INVENTORY)   100    (quantity)     
(ID)  
(C)  (INVENTORY)  (table)      (quantity) 100
 100    
(D)  (INVENTORY)   100         
  (ID)  

15. MySQL     (relation)  2  (tuples)  3 
(attributes)    2 Attributes   (delete)    4 tuples  
    (relation)   (cardinality)   ? 1

(A) 4 (B) 5
(C) 6 (D) 7

16. SQL ,   (table)        (aggregate function)
   (smallest value)   (return)   ? 1

(A) MIN() (B) MAX()

(C) SMALL() (D) LOWER()

17. Computer Networks   ,      RJ 45      ? 1

(A) Radio Jockey 45 (B) Registered Jockey 45
(C) Radio Jack 45 (D) Registered Jack 45

91* 8 * Page

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 8 of 32

Page 10

m
m .co

m .co s e m
se g l a
14. What will be the output of the query ? a 1

SELECT MACHINE_ID, MACHINE_NAME FROM INVENTORY

WHERE QUANTITY <= 100;

(A) All columns of INVENTORY table with quantity greater than 100

(B) ID and name of machines with quantity less than 100 from
m
c o m
INVENTORY table
m .co
m .
(C) All columns of INVENTORY table with quantity greater than or equal s e
s e g l a
toa100 a
g l
(D)a ID and name of machines with quantity less than or equal to 100
from INVENTORY table.

15. A relation in MySQL database consists of 2 tuples and 3 attributes. If 2
attributes are deleted and 4 tuples are added, what will be the cardinality

om
of the relation ? 1

(A) 4 . c
e m(B) 5

(C) 6
s
la (D) 7
ag
16. Which aggregate function in SQL returns the smallest value from a
column in a table ? 1

(A) MIN() (B) MAX()

(C) SMALL() (D) LOWER()
m
m
c.17.o With respect to computer networks, which of the followingsisemthe correct .co
s em expanded form of RJ 45 ? g l a
la a 1

ag (A) Radio Jockey 45 (B) Registered Jockey 45

(C) Radio Jack 45 (D) Registered Jack 45

91* 9 * Page P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 9 of 32

Page 11

18.     (Network device)    (entry)   (exit) 
(point)      ,            (data)
     (routing paths)         
 ? 1

(A)  (Modem) (B)  (Gateway)
(C)  (Switch) (D)  (Repeater)

19. XML   (full form)   ? 1

 . 20  21  (Assertion) (A)   (Reason) (R)    
        
(A)  (A)   (R)      (A)     (R)  
(B)  (A)   (R)   ,   (A)     (R)
  
(C)  (A)  ,   (R)   
(D)  (A)  ,   (R)   

20.  (A) : [1,2,3]+'123'      (invalid
expression)   1

 (R) :    (list)   (string)       

21.  (A) : SQL   (PRIMARY) KEY  (constraint) 
       value  (unique)  
NULL    1

 (R) :  (Candidate) keys  (Primary) key   
  

91* 10 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 10 of 32

Page 12

m
m .co

m .co s em
se g la
a point of a network, as
18. Which network device serves as the entry and exit
all data coming in or going out of a network must first pass through it in
order to use routing paths ? 1

(A) Modem (B) Gateway

(C) Switch (D) Repeater
m
c o m m .co
. 1 se
em
19. Expand the term XML.
s g l a
g la a
Q. a
Nos. 20 and 21 are Assertion (A) and Reason (R) based questions. Mark
the correct choice as :

(A) Both Assertion (A) and Reason (R) are true and Reason (R) is the
correct explanation for Assertion (A).

(B) Both Assertion (A) and Reason (R) are true and Reason (R) is not the
m
correct explanation for Assertion (A).
.co
s em
(C) Assertion (A) is true, but Reason (R) is false.
g la (R) is true.
a
(D) Assertion (A) is false, but Reason

20. Assertion (A) : [1,2,3]+'123' is an invalid expression in Python. 1

Reason (R) : In Python, a list cannot be concatenated with a string.

o m
21.mAssertion (A) : The PRIMARY KEY constraint in SQL ensures c
. that
c. o s
m
e cannot be
e m each value in the column(s) is unique and
l a
l as NULL.
a g 1
ag Reason (R) : Candidate keys are not eligible to become a primary
key.

91* 11 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 11 of 32

Page 13

 –  (7  2 = 14)
22.  (Python)    (default parameters)   
(Positional parameters)      ?    (Function header) 
           2

23.           (  (BUILT_IN)
 (FUNCTION) /  (METHODS)     2
(i)  (List) L       (List) L1    (ascending
order)   (List) L   (elements)   (arrange)  
(ii)    (character), ch   (alphabet)         
   (statement)  
24.       D1   (dictionary) , 2
(i) (a)    (Python expression) ,      
Key 'RNo', D1     

(b)       Python expression   D1   key 
value 12  
(ii) (a) D1   key 'RNo'    key : value pair 'RNo':12  
   (BUILT_IN)        statement
   key 'RNo'    function    (value)
   

(b) D1   elements   (delete )    statement  

25.   (Code)   (execution)       / 
    ?          code   
for loop  ? 2
import random
a = [1,2,3,4,5,6]
for i in range(4):
j = random.randrange(i, 5)
print{a[j],end='–')
print()
Options :
(A) 3–4–5–4– (B) 2–2–4–5–
(C) 4–3–3–5– (D) 5–1–2–4–

91* 12 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 12 of 32

Page 14

m
m .co

m .co s e m
se g l a
SECTION – B a
(7  2 = 14)
22. What is the difference between default parameters and positional
parameters in Python ? Also give an example of a function header which
uses both. 2

23. Write a Python statement to perform the following tasks : (USE
BUILT_IN FUNCTIONS / METHODS ONLY) 2
m
.co
(i) To create a new list L1 containing the elements of list L arranged in
o m
ascending order, without modifying list L.
m
. c
(ii) A statement to check whether the given character, ch is an alphabet s e
em
or asnumber.
g l a
l a a
ag that D1 is a dictionary in Python,
24. Assuming 2
(i) (a) Write a Python expression to check if the key, 'RNo' is present
in D1.
OR
(b) Write a Python expression to check if any key in D1 has a value
12.
(ii) (a)
m
Write a single statement using a BUILT_IN function to add the

m .co
key : value pair 'RNo' : 12, if the key 'RNo'is not present in
D1. However, if the key 'RNo' is present, the function should
s e
return its value.
g la
(b)
aOR
Write a single statement to delete all the elements from D1.

25. What possible output(s) from the given options will NOT be displayed
when the following code is executed ? Also, mention, for how many
iterations the for loop in the given code will run ? 2
import random
a = [1,2,3,4,5,6]
m
mfor i in range(4): .co
m .co j = random.randrange(i,5)
s e m
s e print(a[j],end='–')
g l a
g la print() a
a Options :
(A) 3–4–5–4– (B) 2–2–4–5–
(C) 4–3–3–5– (D) 5–1–2–4–

91* 13 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 13 of 32

Page 15

26.          string s     string   
  (Vowels)     (return)           
       (logical errors)
     
   (Syntax errors)             
    2
def CountVowels(s):
c=0
for ch in range(s):
if 'aeiouAEIOU' in ch:
c=+1
return(ch)

27.        (Production Manager)    
(mineral water)              
    (table)             
    : 2
W_Code –    (type – CHAR(5))
W_Description –    (type – VARCHAR(20))
B_Qty –     (type – INTEGER)
U_Price –     (type – FLOAT)
 (table)   W_STOCK  
(i) (a)   (table)     SQL command  
(W_Code  (primary) key   )

(b)  U_Price     key    ?   
  
(ii) (a)     table W_STOCK      ,    
(attribute) E_Date (DATE type )     SQL
command  

(b)     table W_STOCK      , table  B_Qty
     SQL command  

91* 14 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 14 of 32

Page 16

m
m .co

m .co s em
se g la
26. The function given below is written to accept aastring s as a parameter
and return the number of vowels appearing in the string. The code has
certain errors. Observe the code carefully and rewrite it after removing all
the logical and syntax errors. Underline all the corrections made. 2
def CountVowels(s):
c=0
for ch in range(s): m
m .co
.co m
if 'aeiouAEIOU' in ch:
s e
s em c=+1 l a
g la
return(ch) ag
a
27. Ms. Zoya is a Production Manager in a factory which packages mineral
water. She decides to create a table in a database to keep track of the
stock present in the factory. Each record of the table will have the
following fields : 2
W_Code – Code of the item (type – CHAR(5))

o m
W_Description – Description of the item (type – VARCHAR(20))
. c
B_Qty – Balance quantity of the item
e m(type – INTEGER)
s
la (type – FLOAT)
U_Price – Unit Price of the item
ag
The name of the table is W_STOCK.
(i) (a) Write an SQL command to create the above table (W_Code
should be the primary key).
OR
(b) Can U_Price be the primary key of the above table ? Justify
your answer.
o m
m(ii) (a) Assuming that the table W_STOCK is already created, c
.write an
c. o s
SQL command to add an attribute E_Date (of DATE m
e type) to the
e m l a
las table.
ag
ag OR
(b) Assuming that the table W_STOCK is already created, write an
SQL command to remove the column B_Qty from the table.

91* 15 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 15 of 32

Page 17

28. (a)   (Bus topology)         2

(b)       (Protocol)  ?     
    Protocol     ?

 –  (3  3 = 9)

29. (a)      "Space.txt"  text file   
(digits)          (return)      ,
      : 3
Space exploration has unlocked incredible
advancements in technology and science. Since the
first moon landing in 1969, space agencies have sent
probes to Mars, Jupiter and beyond. The ISS,
orbiting Earth at about 400 km, serves as a hub for
research. With missions planned for 2030, humanity’s
cosmic journey continues!

   11  (return)   

(b)      Space.txt        
   'e'            ,    
  :
Space exploration has unlocked incredible
advancements in technology and science. Since the
first moon landing in 1969, space agencies have sent
probes to Mars, Jupiter and beyond. The ISS,
orbiting Earth at about 400 km, serves as a hub for
research. With missions planned for 2030, humanity’s
cosmic journey continues!

       
incredible advancements science. agencies serves
research.

91* 16 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 16 of 32

Page 18

m
m .co

m .co s em
se g la
28. (a) a Bus topology.
List one advantage and one disadvantage of 2
OR
(b) What is protocol in the context of computer networks? Which
protocol is used to transmit hypertext across the web?

SECTION – C (3  3 = 9)
m
m .co
29. (a)
.co
Write a Python function that counts and returns the number of
m s e m
digits appearing in the text file "Space.txt". For example, if the
s e l a
a
file
l contains :
ag 3
agSpace exploration has unlocked incredible
advancements in technology and science. Since the
first moon landing in 1969, space agencies have sent
probes to Mars, Jupiter and beyond. The ISS,
orbiting Earth at about 400 km, serves as a hub for
research. With missions planned for 2030, humanity’s
cosmic journey continues!

o m
.
Then the function should returnm11.
c
s e
g la
OR
(b) a that displays the words in which the
Write a Python function
lowercase letter 'e' appears at least twice in the text file
'Space.txt'. For example, if the file contains :
Space exploration has unlocked incredible
advancements in technology and science. Since the
first moon landing in 1969, space agencies have sent
probes to Mars, Jupiter and beyond. The ISS,
m
m orbiting Earth at about 400 km, serves as a hub for
.co
m .co research. With missions planned for 2030, humanity’s
s e m
s e cosmic journey continues!
g l a
g la a
a Then the function should display :
incredible advancements science. agencies serves
research.

91* 17 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 17 of 32

Page 19

30. (a) FruitStack   stack,   list ()   (implement)
  ,           ‘Name’, ‘Origin’, ‘Price’
 ‘Expiry’ Keys   dictionary          
    : 3
{'Name':'Apple','Origin':'France','Price':120,
'Expiry':'12-08-2025'}
FruitStack    (Operations)      
    (User defined functions)   :
(i) push_fruit(FruitStack, Fruit):   FruitStack
     Fruit   (argument)      
  (Price) 100   ,  Fruit     record 
FruitStack   (push)   
(ii) pop_fruit(FruitStack):    (stack)  
(topmost)    (pop)    (return)    
stack         “UNDERFLOW”    
(iii) display(FruitStack):     (topmost element)
   Stack   elements       stack 
(empty)     “EMPTY STACK”    

(b) User  10 integers  input          User
     (three digit even integer)      stack
        , stack        (three digit
even integers) pop     (display)       ,
12, 31, 320, 457, 6, 92, 924, 220, 1, 218   (entry)    Stack
    
320, 924, 220, 218
   output    :
218 220 924 320
31. (a)   (code)  output  : 3
def Exam2026(given) :
new=[]
for ch in given[1:-1]:
if ch.isupper():
new.reverse()
elif ch not in new:
new.append(ch)
elif ch in new:
new.pop()
print(new)
Exam2026("Gold–24Medals")

91* 18 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 18 of 32

Page 20

m
m .co

m .co s em
se g la
30. (a) a using list, contains
A stack named FruitStack, implemented
records of some fruits. Each record is represented as a dictionary
with keys ‘Name’, ‘Origin’, ‘Price’, and ‘Expiry’. A sample record is
given here : 3
{'Name':'Apple','Origin':'France','Price':120,
'Expiry':'12-08-2025'}
Write the following user-defined functions in Python to perform the
specified operations on FruitStack :
m
(i) push_fruit(FruitStack, Fruit): This function takes the
m .co
m .co
stack FruitStack and a new record Fruit as arguments and
pushes the record stored in Fruit onto FruitStack if the s e m
s e l a
ag
Price is less than 100.
g l a
(ii) pop_fruit(FruitStack): This function pops the topmost
a record from the stack and returns it. If the stack is already
empty, the function should display “UNDERFLOW”.
(iii) display(FruitStack): This function displays all the
elements of the stack starting from the topmost element. If the
stack is empty, the function should display ‘EMPTY STACK’.
OR
(b) Write a Python program to accept 10 integers from the user. If the
m
entered number is a three-digit even integer, push it onto a stack.

m .co
After all inputs are taken, pop all the three-digit even integers from
the stack and display them. For example, if the user enters 12, 31,
s e
320, 924, 220, 218 g la
320, 457, 6, 92, 924, 220, 1, 218, then the stack should contain :

a
and the output of the program should be :
218 220 924 320

31. (a) Write the output of the following code : 3
def Exam2026(given) :
new=[]
for ch in given[1:-1]:
if ch.isupper():
m
m new.reverse()
.co
m .co elif ch not in new:
s e m
s e new.append(ch)
g l a
la
elif ch in new:
g new.pop() a
a print(new)
Exam2026("Gold–24Medals")
OR

91* 19 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 19 of 32

Page 21

(b)    output  :
def Exam2026(given):
new = 0
while given:
if new % 2:
new += given % 10
else:
new += given % 5
print(new, end='–')
given //= 10
Exam2026(123456)

 –  (4  4 = 16)

32.   STOCK     (table)           
data       (set)   Table       (data) 
   table      : 41=4

(a)    data        SQL queries  
(i)         (Type)  
(Maximum Price)  
(ii)     Price  0.5     (Type)'F'  
(iii)        (Qty  Price   )
(iv)         Code, 'A'     

91* 20 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 20 of 32

Page 22

m
m .co

m .co s e m
se g l a
(b) Write the output of the following code : a
def Exam2026(given):
new = 0
while given:
if new % 2:
new += given % 10
m
.co
else:
om new += given % 5
c. print(new, e m
em given //= 10 end='–')
l as
las ag
g
a Exam2026(123456)
SECTION – D (4  4 = 16)

32. Abhishek has created a table, named STOCK, with a set of records to
maintain the data of packaged milk in his shop. After creating the table,
he entered the data and the table looked as follows :
m 41=4

m .co
s e
g la
a

(a) Based on the data given above, write the SQL queries for the
following tasks :
(i) To display Type and the maximum Price for each Type of m
m milk. .co
m .co (ii) s em
For each record, increase the Price by 0.5 where Type is 'F'.
s e g a  Price).
lQty
g la (iii) To display the total value of the stock (total of
a
a (iv) To display the details of all records where Code starts with
'A'.
OR

91* 21 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 21 of 32

Page 23

(b)    table STOCK      queries   
output  
(i) SELECT Volume, Qty, Price FROM STOCK
WHERE Type IN ('F','D');
(ii) SELECT Code, Qty from STOCK
WHERE Price BETWEEN 30 AND 50;
(iii) SELECT DISTINCT Type FROM STOCK;
(iv) SELECT Volume, count(*) FROM STOCK GROUP BY
Volume;

33. "States.csv"   csv             
      : 4
   
   
   
   
           :
['Andhra Pradesh','Amaravati',52221000,'Telugu']
 Python             ,  
10000000   ,   csv  'More.csv'    
 : "States.csv"  Header row    Header row  More.csv 
     

34.        (Finance House)        
        (tables) : CUSTOMERS  LOANS    
 tables    (sample data)     : 41=4
Table: CUSTOMERS

91* 22 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 22 of 32

Page 24

m
m .co

m .co s em
se g la
(b) a write the output on
Considering the table STOCK as given above,
execution of the following queries :
(i) SELECT Volume, Qty, Price FROM STOCK
WHERE Type IN ('F','D');
(ii) SELECT Code, Qty FROM STOCK
WHERE Price BETWEEN 30 AND 50;
(iii) SELECT DISTINCT Type FROM STOCK; m
m .co
.co m
(iv) SELECT Volume, count(*) FROM STOCK GROUP BY
Volume; s e
s em g l a
l a a
33. A csvgfile "States.csv" contains some data about all the states of India.
a
Each record of the file contains the following data : 4
 Name of the State
 Capital of the State
 Population of the State
 Official Language of the State
For example, a sample record in the file is :
m
['Andhra Pradesh','Amaravati',52221000,'Telugu']
m .co
e
Write a Python program which reads the data from this file and appends
s
la
all those records where population is more than 10000000 into another
g
csv file 'More.csv'. a
Note : "States.csv" also contains the Header row. The Header row
should NOT be copied to "More.csv".

34. Assume that you are the Manager of the Loans department of a Finance
House. To keep track of the loans you have created two tables : CUSTOMERS
and LOANS. The sample data in these tables is given below : 41=4
m
m Table: CUSTOMERS
.co
m .co s e m
s e g l a
g la a
a

91* 23 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 23 of 32

Page 25

Table: LOANS

 : tables              
                
     queries  
(i) LOANS          (RoI) 7.0    
(ii)         (L_Amt) 1000000    
(iii)     C_ID, C_Name  Terms     (L_Date)
31 , 2024     
(iv) (a)   (RoI)    (descending order)      

(b) LOANS table   C_ID   C_ID    (term) 

35.   MySQL , SCHOOL  Account      ,   
  : 4
 Stud_id – integer
 Sname – string
 Class – string
 Fees – float
          (Python)      
 5000    
 (Python)  MySQL    (connection)     
   :
 Username – admin
 Password – root
 Host – localhost

91* 24 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 24 of 32

Page 26

m
m .co

m .co s e m
se g l a
Table: LOANS a

m
c o m m .co
. e
em of the Finance House needs certain reports from you. glas
Note : The tables may contain more records than shown here.
s
The management
a queries to extract the following data to create the reports : a
Write lthe
g
(i) a Number of records from LOANS table where Rate of Interest (RoI) is
above 7.0.
(ii) Names of the customers whose loan amount (L_Amt) is above
1000000.
(iii) C_ID, C_Name and Terms of all those records where Loan Date
(L_Date) is after 31st December, 2024.
(iv) (a) m
Details of all the loans in the descending order of RoI.
OR
m .co
(b) s e
C_ID and average term for each C_ID from the LOANS table.
g la
a
35. Peter has created a table named Account in MySQL database, SCHOOL,
having following structure : 4
 Stud_id – integer
 Sname – string
 Class – string
 Fees – float
o m
mHelp him in writing a Python program to display records of those c
.students
c. o whose fees is less than 5000. s e m
e m Note the following to establish connectivity between Python a
l and MySQL :
l as a g
ag 

Username – admin
Password – root
 Host – localhost

91* 25 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 25 of 32

Page 27

 –  (2  5 = 10)
36.     (ICT)        (Training
workshops)     Next Step       
(Resource Persons)             
 (    )    RESOURCES.DAT  
(Binary)        2+3=5
(R_ID, R_Name, R_Expertise, Charges)
 :
R_ID –      (Resource Person ID) (An integer)
R_Name -     (Resource Person Name) (A string)
R_Expertise -       (Area of Expertise of the
Resource Person)
Charges -         ( )
  ,      :
(12, 'P. Velusami','Machine Learning',5000)
       (user defined functions)   
 :
(i) Append() –      (input)   RESOURCES.DAT
   
(ii) Update() –      (Charges) 500  

37. ,           (head office)  
                   
 (ADMIN),  (ACADEMIC),  (HOSTEL),  (SPORTS) 
 /  
 /                (i) 
(v)    /        -    
            51=5
  

   
(ADMIN Block) (ACADEMIC Block)

   
(HOSTEL Block) (SPORTS Block)

91* 26 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 26 of 32

Page 28

m
m .co

m .co s e m
se g l a
SECTION – E a (2  5 = 10)
36. NextStep is an organization which has a pool of resource persons to
conduct training workshops on various topics related to ICT. The data of
all its Resource Persons is stored in a binary file RESOURCES.DAT using
the following record structure (each record is a tuple) : 2+3=5
(R_ID, R_Name, R_Expertise, Charges)
where :
m
R_ID m
– Resource Person’s ID (An integer)
c. -o Resource Person’s Name (A string) m .co
R_Name
m s e
s e l a
R_Expertise - Area of expertise of the Resource Person
g l a ag
a
Charges - Charges (in rupees) per hour to conduct a workshop
For example, a record in the file is :
(12, 'P. Velusami','Machine Learning',5000)
In this context, write the following user defined functions in Python :
(i) Append() – To input the data of a Resource Person and write it in
the file RESOURCES.DAT.
(ii) m
Update() – To increase the Charges of each resource person by
500. .co
s em
g la institutions with its head office in
37. Sanjeevani is a big group of educational
Hyderabad. It is planning to a set up a new University in Amritsar. The
Amritsar University Campus will have four blocks/buildings – ADMIN,
ACADEMIC, HOSTEL, SPORTS. You, as a network expert, need to
suggest the best network-related solutions for them to resolve the
issues/problems mentioned in points (i) to (v), keeping in mind the distances
between various blocks / buildings and other given parameters. 51=5
Amritsar University Campus
m
m .co
m .co ADMIN ACADEMIC
s e m
s e Block Block
g l a
g la a
a HOSTEL SPORTS
Block Block

91* 27 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 27 of 32

Page 29

Block to Block distances (in Mtrs.)
FROM TO DISTANCE
 (ADMIN) (ACADEMIC) 60 M

 (ADMIN) (HOSTEL) 160 M

 (ADMIN)  (SPORTS) 80 M

(ACADEMIC) (HOSTEL) 40 M

(ACADEMIC)  (SPORTS) 120 M

(HOSTEL)  (SPORTS) 150 M

         = 2000 ..  
         :
 (ADMIN) 25

(ACADEMIC) 600

(HOSTEL) 120

 (SPORTS) 50

(i)       (server)      
       
(ii)              
cable layout    

(iii)                
     (wired media)    
(iv)     ,        (24  7),
 FM     FM       
(Communication medium)      ?

(A)   (Radio Waves)
(B)   (Micro Waves)
(C)   (Infrared Waves)

91* 28 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 28 of 32

Page 30

m
m .co

m .co s e m
se g l a
Block to Block distances (ina Mtrs.)
FROM TO DISTANCE

ADMIN ACADEMIC 60 M

ADMIN HOSTEL 160 M

ADMIN SPORTS 80 M
m
.co
ACADEMIC HOSTEL 40 M
m
.co
ACADEMIC SPORTS 120 M
s e m
s emHOSTEL l a
ag
SPORTS 150 M
l a
ag of Hyderabad Head Office from Amritsar University Campus =
Distance
2000 km.

Number of computers in each block is as follows :
ADMIN 25

ACADEMIC 600

HOSTEL
o m120
.c
em
SPORTS 50

(i)
s
la location of the server inside the
Suggest the most appropriate
g
a Justify your choice.
Amritsar University Campus.

(ii) Draw the cable layout to efficiently connect various blocks within
the Amritsar University Campus.

(iii) Name any two wired media that can be used to connect various
computers of a block inside Amritsar Campus.

(iv) m
For the academic purpose, the University will provide its own 24  7
o
m .
FM channel within the University Campus. Which communicationc
m .co medium, out of the following, is used by FM ?
s e m
s e g l a
g la (A) Radio Waves
a
a (B) Micro Waves

(C) Infrared Waves

91* 29 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 29 of 32

Page 31

(v) (a)    (online)         
-  (Audio-visual communication)    
 (Protocol)           
     

(b)     (signals)       
   (repeater)      ?   
  
_____________

91* 30 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 30 of 32

Page 32

m
m .co

m .co s em
se g la
(v) (a) The students will be attending a lot ofaonline academic sessions
and workshops. These will involve audio-visual communication.
Write the full name of the protocol which will be used for such
a communication through the internet.
OR
(b) Where should a repeater be installed in Amritsar University
m
m
campus to boost the signal between blocks ? Justify your .co
.co
answer.
m s e m
s e l a
g l a _____________
ag
a

m
m .co
s e
g la
a

m
m .co
m .co s e m
s e g l a
g la a
a

91* 31 * P a g e P.T.O.

m .
.co s e m
s em l a
g la ag
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 31 of 32

Page 33

91* 2334 32 * P a g e

For more Question Papers, Sample Papers, Notes & Syllabus visit Page 32 of 32

Document Details

Board / OrgCBSE
ExamClass 12
TypeQuestion Paper
Pages33
Languageenglish
Updated24 Sep 2026