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

Class 12 Sample Paper 2026 Computer Science

Download Class 12 Sample Paper 2026 Computer Science pdf. Prepare effectively with Class 12 Computer Science Model Paper 2026 at aglasem.com. This sample question paper is designed as per the latest ncert syllabus and exam pattern to help you practice important questions, understand the marking scheme, and improve time management. Class 12 Sample Paper 2026 Computer Science is given below. More Detail
Class 12 Sample Paper 2026 Computer Science - Page 1 of 8

Finished viewing? Save it for later —

Download Class 12 Sample Paper 2026 Computer Science (PDF · 8 pages)
Downloaded 111 times

About Class 12 Sample Paper 2026 Computer Science

Class 12 Sample Paper 2026 Computer Science is available here for free download. Published by AglaSem for Class 12, this sample paper can be viewed online or downloaded as a PDF (8 pages). Candidates preparing for Class 12 can use Class 12 Sample 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 Class 12 Sample Paper 2026 Computer Science?

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

Is Class 12 Sample Paper 2026 Computer Science free to download?

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

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

Class 12 Sample Paper 2026 Computer Science contains 8 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.

Class 12 Sample Paper 2026 Computer Science – Text

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

📄 View text version (8 pages)

Page 1

2026
SAMPLE / MODEL
PAPERS
NCERT BASED
PRACTICE PAPERS
DOWNLOAD PDF

FOR
CBSE BOARD
AND
STATE BOARDS

Page 2

COMPUTER SCIENCE – CODE NO. 083
PRACTICE QUESTION PAPER
Class - XII - (2025-26)
Time Allowed: 3 Hrs. Maximum Marks: 70

General Instructions:
• This question paper contains 37 questions.
• All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions.
• The paper is divided into 5 Sections- A, B, C, D and E.
• Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
• Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
• Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
• Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
• Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
• All programming questions are to be answered using Python Language only.
• In-case of MCQ, text of the correct answer should also be written.

Q No. Section-A (21 x 1 = 21 Marks) Marks
1 State if the following statement is True or False: 1
id(10) == id(10) will always return True in Python.
2 What will be the output of the following code? 1
S = ["AI", "Machine", "Learning"]
print(S[0][1] + S[2][0])

a) AI b) In c) IL d) aL
3 Consider the given expression: 1
print(not 5>7 or 3==3 and False)
Which of the following will be the correct output of the given expression?
a) True b) False c) Error d) None
4 Which SQL join returns only matching rows from both tables? 1
a) FULL JOIN b) INNER JOIN c) LEFT JOIN d) CROSS JOIN
5 What will be the output of the following Python code? 1
s = "PROGRAM"
print(s[-2::-2])
a) AMRP b) MRPG c) AGRM d) MGOR
6 Write the output of the following Python code: 1
for i in range(4, 16, 4):
print(i, end="*")
7 What will be the output of the following Python statement: 1
print(50/5 + 2**3 - 9)
a) 10 b) 9 c) 11 d)8
8 Correct the given SQL Query: 1
SELECT dept, AVG(salary) FROM employees ______ AVG(salary)>40000 GROUP BY
dept;
a) HAVING b) WHERE c) ORDER BY d) WITH

1|Page

Page 3

9 What will be the output of the following Python code? 1
try:
n = int("123a")
except ValueError:
print("Invalid number")
except:
print("Error")
a) Invalid number b) Error
c) 123a d) No output
10 What will be the output of the following Python code? 1
d = {"name":"Raj", "city":"Pune"}
print(d.get("email","NA"))
a) Raj b) Pune c) None d) NA
11 What possible output is expected to be displayed on the screen at the time of execution of the 1
Python program from the following code?
import random
L=[5,10,15,20]
a=random.randint(0,0)
b=random.randint(1,1)
for i in range(a,b+1):
print(L[i], end="#")

a) 5#10# b) 5# c) 10# d) 5#10#15#

12 What will be the output of the following Python code? 1
x=2
print(x, end='--')
def test():
global x
x += 10
print(x, end="==")
test()
print(x)

a) 2--12==12 b) 2--2==12 c) 2--12==2 d)12--12==12
13 Which SQL command can affect both rows and columns count? 1
a) Insert b) Delete c) Both a) & b) d Drop
14 What is the output of the given Python code? 1
txt="banana split"
print(txt.split("n"))
a) ['ba','a','a split'] b) ['ba','a','a split']
c) ['ba','a','a spl','it'] d) ['ba','','a','a split']
15 In SQL, a table has 5 columns. 3 more added. Then what will be the Degree of the table? 1
a) 5 b) 7
c) 8 d) 9

16 Which SQL command to permanently delete a table in MySQL? 1
a) DELETE b) DROP c) TURNCATE d) REMOVE

2|Page

Page 4

17 Which protocol is used to send emails: 1
a) HTTP b) FTP c) POP3 d) SMTP
18 Which device is used to connect multiple computers within the same LAN and forward data 1
only to the intended destination device?
a) Hub
b) Switch
c) Modem
d) Repeater

19 Which device is used to protect network by filtering traffic? 1
a) Repeater b) Firewall c) Modem d) Switch
Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the correct choice as:
a) Both A and R are True and R is the correct explanation for A.
b) Both A and R are True and R is not the correct explanation for A.
c) A is True but R is False.
d) A is False but R is True.
20 Assertion (A): Tuple can store duplicate values. 1
Reason (R): Tuples are immutable.
21 Assertion (A): Foreign key is used to maintain referential integrity between two tables 1
in a database.
Reasoning (R): Foreign key must always reference the primary key of another table.
Q No. Section-B (7 x 2=14 Marks) Marks
22 A. Explain the difference between mutable and immutable with examples. 2
OR
B. Explain the difference between = and == in python with example.

23 The code provided below is intended to print the substring of a given string starting from the 2
3rd character to the end. However, there are syntax and logical errors in the code.
Rewrite it after removing all the errors. Also, underline all the corrections made. def

mid(s)
if len(s)<3
return s
m = s[2:len(s)]
print(m
mid("School’)

24 A. (Answer using Python built-in methods/functions only): 2

I. Write a statement to count letter ‘a’ in string named data.
II. Write a statement to Reverse list L.
OR
B. Predict the output of the following Python code:
msg="Coding With Python"
print(msg.replace("o","@"))
print(msg.startswith("Cod"))

3|Page

Page 5

25 A. Write a function remove_neg(L) to delete negative numbers from list L. 2
OR
B. Write a user–defined function in Python named fact(n) that calculates and returns the
factorial of any positive number entered by the user.
Factorial of a number n is defined as:
n! = n × (n−1) × (n−2) × … × 1
26 Predict the output of the Python code given below: 2
D={"Tom":90,"Ria":75,"Kabir":88,"Zoya":92}
sel=[ ]
for n in D:
if D[n] > 85:
sel.append(n)
print(sel)
27 A. Write suitable commands to do the following in MySQL. 2
I. Display all tables.
II. Delete a table named Student.
OR
B. Differentiate between update and modify query in SQL with a suitable example.
28 A. Define the following terms: 2
I. Cache memory
II. Switch
OR
B.
I. Expand the following terms: TCP and URL
II. Differentiate between web optical fiber and twisted pair.

Q No. Section-C (3 x 3 = 9 Marks) Marks
29 A. Write a Python function that reads a text file named DOE.txt and counts the total 3
number of lines and total number of words in the file.
OR
B. Write a Python program to read a text file named notes.txt and display only those lines
which do not contain the word "AI" (case-insensitive).

30 A list containing records of products as 3
numbers = [12, 5, 45, 7, 60, 3]
Write functions:
i) Push only numbers divisible by 3.
ii) Pop till empty & display, else "Stack Empty".

4|Page

Page 6

31 A. Predict the output of the following Python code: 3
def change(num):
num = num + 5
return num

a = 10
b = change(a)
print(a, b)

x = [1, 2, 3]
y=x
y.append(4)
print(x, y)

OR
B. Predict the output of the following Python code:
fruits=["apple","kiwi","orange","grape","banan
a"]
res=[ ]
for f in fruits:
if f[-1] in "aeiou":
res.append(f[1].upper())
print(res)

Q No. Section-D (4 x 4 = 16 Marks) Marks
32 Consider the table STUDENTS as given below: 4
roll name class marks
101 Riya 12 88
102 Aman 11 72
103 Neha 12 91
104 Rohan 11 78
105 Priya 12 84

A. Write the following queries:
i) Display class-wise average marks only for those classes where the average
marks are greater than 75.
ii) Display all student details sorted by name in ascending order.
iii) Display distinct class numbers from the STUDENTS table.
iv) Display details of students whose name ends with 'a'.

OR
B. Predict the output of the following:
i) SELECT class, COUNT(*) FROM STUDENTS GROUP BY class;
ii) SELECT name, marks FROM STUDENTS WHERE marks > 80;
iii) SELECT name, marks FROM STUDENTS ORDER BY marks DESC LIMIT 3;
iv) SELECT name, class FROM STUDENTS WHERE name LIKE '_i%';

5|Page

Page 7

33 Riya is maintaining a student project file named students.csv that stores details in the format: 4
AdmNo, Name, Class, Marks
She wants to help her teacher quickly identify high-performing students for a scholarship list.
Write a Python program for Riya to:

I. Display names of students who scored 90 or above.
II. Count and display the total number of such students.

34 Amir, a Class 12 Computer Science student, is helping his teacher maintain a school database. 4
Two tables are used in the school's database as given below:

Table: COURSE
cid cname duration
C101 Python 6 months
C102 Java 4 months
C103 AI Basics 3 months
C104 Networking 5 months

Table: STUDENT
sid sname cid
S01 Riya C101
S02 Arjun C103
S03 Meera NULL
S04 Anuj C102

As part of a digital record-keeping project, Amir needs to write SQL queries to analyze the
data stored in the database and support administration decisions.
Write SQL queries to:
i) Display the names of students enrolled in the Python course.
ii) Display all courses that have a duration greater than 4 months.
iii) Delete records of students who are not enrolled in any course (cid is NULL).
iv) A. Display the student name along with the course name using a JOIN.
OR
B. Display the name of students whose name starts with the letter ‘A’.

35 A MySQL database named RetailStoreDB contains a table called stock_master with the 4
following fields:
• Prod_ID — Product ID (Integer)
• Prod_Name — Product Name (String)
• Units_Available — Number of units in stock (Integer)
• Price — Price per unit (Integer)
The database connection details are:
• Username: store_admin
• Password: retail@2025
• Host: localhost
Write a Python program using MySQL connectivity to update the Units_Available to 150 for
the product whose Prod_ID = 502 in the stock_master table.

6|Page

Page 8

Q No. Section-E (2 X 5 = 10 Marks) Marks
36 Riya, a Class 12 Computer Science student, is helping her teacher maintain student records for a 2+3
scholarship selection program.
The student information is stored in a binary file named Stu.dat with the following fields: Roll,
Name, Class, Marks.
Write two Python functions to help Riya:
i) Append new student record to Stu.dat
ii) Read and display the student details having Marks > 80
37 ABC Global Pvt. Ltd. is setting up a new campus in Pune while the main head office is located in 5
Mumbai. The Pune campus will consist of four departments: Admin, Research Lab, Training, and
Support. The building distances and number of computers are given below:
From To Distance (in meters)
Admin Research Lab 80
Admin Training 150
Admin Support 100
Research Training 70
Lab
Research Support 60
Lab
Training Support 85

No. of Computers in each block
Block No. of
Computers
Admin 50
Research 120
Lab
Training 75
Support 30

Answer the following questions:
I. Which department in the Pune campus should host the main server? Justify your answer.
II. Suggest the appropriate placement of the following devices:
a) Repeater
b) Switch
III. Suggest and draw (conceptually) the cable connection layout between buildings.
IV. The company wants to connect its Pune campus with Mumbai head office using a high-
speed wired connection. Which transmission medium should be used and why?
V. a) What is the purpose of a Firewall in a network?
OR
b) Identify the type of network (PAN / LAN / MAN / WAN) formed between the Pune
campus and Mumbai head office.

7|Page

Document Details

Board / OrgAglasem
ExamClass 12
TypeSample Paper
Pages8
Updated24 Sep 2026