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

CBSE Class 12 Sample Paper 2027 for Computer Science

Download CBSE Class 12 Sample Paper 2027 for Computer Science. Here at aglasem.com get latest CBSE Model Papers with Answers to prepare better for your upcoming board exam 2027. CBSE Class 12 Computer Science Sample Question Paper 2027 is given below.
CBSE Class 12 Sample Paper 2027 for Computer Science - Page 1 of 8

Finished viewing? Save it for later —

Download CBSE Class 12 Sample Paper 2027 for Computer Science (PDF · 8 pages)
Downloaded 39 times

About CBSE Class 12 Sample Paper 2027 for Computer Science

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

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

Is CBSE Class 12 Sample Paper 2027 for Computer Science free to download?

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

How many pages does CBSE Class 12 Sample Paper 2027 for Computer Science have?

CBSE Class 12 Sample Paper 2027 for 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.

CBSE Class 12 Sample Paper 2027 for 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 (9 pages)

Page 1

FOR CBSE CLASS 12 PREPARATION

CBSE Class 12 Sample
Paper 2027 for
Computer Science
EXAM YEAR TYPE SUBJECT

CBSE Class 12 2027 Sample Paper Computer Science

Notes · Sample Papers · Previous Year Papers · Mock Tests

Page 2

m
m .co

m .co s e m
se SAMPLE QUESTION PAPERl a
ag
Class XII Session 2026-27
COMPUTER SCIENCE (Code 083)
TIME: 3 hours MAX. 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
m
.co
 The paper is divided into 5 Sections- A, B, C, D and E.
m
.co
 Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
e m
 Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
em
 Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
l as
l as
 Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
ag
ag
 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 Write the output on execution of the following Python code: 1
L1=[10,20,25,30]
m
.co
L1.insert(1,15)
print(L1)
e m
s
2 What will be the output of the following expression? 1
Msg = "programming is amazing"
g la
print(Msg.split("m"))
a) ['progra', '', 'ing is a', 'azing'] a
b) ['progra', 'ming is a', 'azing']
c) ('progra', '', 'ing is amazing')
d) ['program', 'ing is a', 'zing']
3 Which of the following data types in Python is mutable? 1
a) Tuple
b) String
c) Integer
m
.co
d) List
4
m
A column in one table matching a primary key of another table is called a: 1
c. o
a) Composite key
s e m
em a
b) Candidate key
s g l
la
c) Foreign key
g d) Super key a
a 5 Consider the following Python code:
t = (1, 2, 3)
1

l = [4, 5]
print(t + l)
What will happen when this code is executed?
a) [1, 2, 3, 4, 5]
b) (1, 2, 3, 4, 5)
c) Error, because a tuple cannot be concatenated with a list
m .
.co
s e m
s em l a
ag
pg. 1

g la
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 1 of 8

Page 3

d) ((1, 2, 3), [4, 5])

6 What possible output is expected to be displayed on the screen at the time of 1
execution of the Python program from the following code?
import random
games = {0: "Chess",1: "Scrabble",2: "Sudoku",3: "Tic-Tac-Toe",4: "Puzzle"
}
start_key = random.randint(1, 2)
end_key = random.randrange(3, 4)
for k in range(start_key, end_key + 1):
print(games[k], end="@@")
a) Sudoku@@Tic-Tac-Toe@@Puzzle@@
b) Scrabble@@Sudoku@@Tic-Tac-Toe@@
c) Chess@@Scrabble@@Tic-Tac-Toe@@
d) Scrabble@@Tic-Tac-Toe@@
7 Predict the output for the following: 1
Dl={"Pen":12, "Pencil":6, "Scale":5, "InkPen":20}
print(12 in Dl)
a) False
b) Error
c) None
d) True
8 Long-distance communication without line-of-sight is mainly achieved using: 1
a) Microwaves
b) Ultraviolet
c) Radio waves
d) X-rays
9 Which MySQL query will display all employees whose salaries are between 90,000 1
and 100,000 (including limits)?
a) SELECT * FROM Employees WHERE salary > 90000 AND salary < 100000;
b) SELECT * FROM Employees WHERE salary IN (90000, 100000);
c) SELECT * FROM Employees WHERE salary BETWEEN 90000 AND 100000;
d) SELECT * FROM Employees WHERE salary = 90000 OR salary = 100000;
10 What will be the output of the following Python statement: 1
print(25+100**1**3/5)
11 What is the data type of the result when the expression 5 // 2 is evaluated in Python? 1
a) float
b) int
c) string
d) None
12 Every network interface card (NIC) comes with its own ________ address. 1
a) Internet Protocol (IP)
b) Open Systems Interconnection (OSI)
c) Physical (MAC)
d) Dynamic Host Configuration Protocol (DHCP)
13 In a student table, “Class” can only take values from {IX, X, XI, XII}. This set is called 1
the ________.
a) Domain
b) Tuple

pg. 2

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

Page 4

m
m .co

m .co s e m
se c) Attribute
g l a
d) Key a
14 What would be written in the file errorlog.txt after the following code is run? 1
def data(num):
try:
return 190/(29-num)
except ZeroDivisionError:
logfile = open ("errorlog.txt", "w")
logfile.write ("Num was 29")
m
m
logfile.close()
.co
data(29)
.co s em
em a
15 Which of the following will NOT change if you insert a new record into a table? 1
s l
a ag
a) Cardinality
l
ag
b) Degree
c) Number of tuples
d) Total rows
16 What will be the output of the following Python code? 1
y=8
def update():
y=y+2
print(y)
update()
m
.co
a) 10
b) 8
c) Error
e m
d) None
las
between the sender and the receiver. ag
17 In ________ switching, before a communication starts, a dedicated path is identified 1

a) Graph
b) Plot
c) Circuit
d) Packet
18 What will be the output of the following Python code? 1
text = "Drone Expo"
print(text[-2: :-4])
m
c. o
19 Which MySQL command correctly removes an attribute Age from table Student? 1
m
a) ALTER TABLE Student DROP COLUMN Age;

m .co b) ALTER TABLE Student REMOVE Age;
s e m
s e
c) DROP COLUMN Age FROM Student;
g l a
la
d) DELETE COLUMN Age FROM Student;

g Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the correct choice as: a
a 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): Opening a file in mode rb allows you to read a binary file without 1
modifying it.
Reason (R): In rb mode, if the file does not exist, Python creates a new empty file.

m .
.co
s e m
s em l a
ag
pg. 3

g la
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 3 of 8

Page 5

21 Assertion (A): The MySQL query SELECT Student_Name FROM Student WHERE 1
Guardian_Phone IS NULL; displays the names of students whose guardian phone
number is not recorded.
Reason (R): In MySQL, you can also use = to check for NULL values; it is equivalent
to IS NULL to identify columns with no value.
Section-B ( 7 x 2=14 Marks)
22 A. Define global variable and local variable with a suitable example. 2
OR
B. Write the difference between the seek() and tell() methods in Python text file
handling with a suitable example.
23 The Python program below tries to print the list in reverse. However, there are 2
syntax and logical errors in the code.
Rewrite it after removing all the errors. Also, underline all the corrections made
words=["Class Test","Term Exams","Pre-board Exam","Board Exam’]
L=len(words)
for i in range(L, -1, -1)
Print (words[i] , end = " ")
24 A. Write a Python function capitalize_words(words) that takes a list of strings 2
words and returns a new list with each word capitalize.

Example:
If the input is ["python", "computer", "science"]
The output should be ["Python", "Computer", "Science"].
OR
B. Write a Python function sum_positive(list1) that takes a list of numbers and
prints the sum of all positive numbers in the list.
Example:
If the input is [10, -5, 20, -3, 7]
The output should be 37.

25 A. (Answer using Python built-in methods/functions only): 2
I. Write a statement to check whether the string username starts with "admin".
II. Given data = [2, 7, 9, 9, 2], write a statement to count how many times the
largest element occurs.
OR
B. Predict the output of the following Python code:
text = "Python Programming"
print(text.replace("o", "0"))
print(text.find("z"))

26 Predict the output of the following Python code: 2
code = "gLaD5"
result = []
i=0
while i < len(code):
if code[i].isupper():
result.append(code[i].lower())

pg. 4

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

Page 6

m
m .co

m .co s e m
se elif code[i].isdigit():
g l a
result.append(int(code[i]) * 2) a
else:
result.append("#")
i += 1
print(result)
27 A. Write suitable commands to do the following in MySQL. 2
I. Display a list of all the relations stored in a database.
II. Delete a database named CS_SP.
m
.co
OR
m
B. Differentiate between alter and update command in MySQL with a suitable
example.
.co s em
28
em
A. Which protocol helps us to browse through web pages using internet browsers?
s l a 2

a ag
Name any one internet browser.
l
ag
OR
B. Define tree topology. Also, write down any one limitation of tree topology.
Section-C ( 3 x 3 = 9 Marks)
29 A. Write and call a Python function to read "History.txt" and display all lines that 3
contain a four-digit year (e.g., 1999, 2024 etc.)
OR
B. Write a Python function that displays the number of times the word "Python"
appears in a text file named "Prog.txt".
m
.co
30 A list containing records of books is given as: 3
B = [("Machine Learning Basics", 550), ("World Geography", 450), ("Wonder World",
e m
s
140), ("AI Revolution", 750)]

la
Write the following user-defined functions to perform operations on a stack named
g
Books:
a
I. Push_element(): Push only those books whose price is more than 250 into the
stack.
II. Pop_element(): Pop the items from the stack and display them.
After all items are popped, display "Stack Empty".
Expected Output:
('AI Revolution', 750)
('World Geography', 450)
('Machine Learning Basics', 550)
m
.co
Stack Empty
m
c. o
31 A. Write a Python function avg_len( ) segment that adds up the lengths of all the 3
words in a list and then prints the average (mean) length.
e m
e m OR
l as
las ag
B. Consider the tuple pairs = ((2,5),(4,2),(9,8),(12,10)). Write a Python function

ag cnt_even( ) to count the number of pairs (a, b) where both a and b are even.

Section-D ( 4 x 4 = 16 Marks)

m .
.co
s e m
s em l a
ag
pg. 5

g la
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 5 of 8

Page 7

32 Consider the table TECH_EVENT_REG as given below: 4

A. Write the following queries:
I. To display the number of participants in each event where the number of
participants is greater than 1.
II. To display the distinct event names available in the Tech Event.
III. To display details of participants whose names contain the letters ‘an’.
IV. To display all records of TECH_EVENT_REG sorted by participant_name in
descending order.
OR
B. Predict the output of the following:
I. Select participant_name, event_name from tech_event_reg where grade = 11;
II. Select event_name, count(*) from tech_event_reg group by event_name;
III. Select participant_name from tech_event_reg where event_name like
'%challenge';
IV. Select max(reg_fee) from tech_event_reg where grade in (9, 10);
33 Kabir runs a vehicle rental agency and maintains a CSV file named Rentals.csv. 4
The file stores daily rental details with columns:
Vehicle_ID, Vehicle_Type, Hours_Rented, Rate_Per_Hour
Create the following user-defined functions:
I. AddRental() – to accept rental details from the user and append them to
Rentals.csv.
II. CalculateTotalRent() – to calculate and return the total rent earned
(Hours_Rented × Rate_Per_Hour).
34 Aditi is managing an events database and needs to access certain information from 4
the chess_event and registrations tables for an upcoming survey. Help her extract the
required information by writing the appropriate MySQL queries as per the tasks
mentioned below:
Table: Chess_Event

Table: Registrations

pg. 6

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

Page 8

m
m .co

m .co s e m
se g l a
a

m
m .co
I.
.co
Write a MySQL query to update the venue of the event "Inter-School Chess
s e m
em
Championship" to "Multi-Purpose Hall".
s g l a
II.
l a
Display the details of all chess events scheduled after 2025-01-01.
a
III.
ag
Write a MySQL query to display the registration details of students who have
registered for events scheduled in ‘Auditorium Hall’, ‘Activity Room 3’, or ‘Library
Conference Area’.
IV. a. Display the student_name along with the event_name for all registrations
or
b. Write a MySQL query to display the cartesian product of Chess_Event and
Registrations tables.

m
c. o
35 MySQL database named LibraryDB has a table book_records which contains the 4
following attributes:
• Book_ID: ID of the book (Integer)
e m
• Book_Title: Title of the book (String)
las
• Author: Author of the book (String)
ag
• Copies: Number of copies available (Integer)

Consider the following details to establish Python-MySQL connectivity:
• Username: librarian
• Password: lib@2025
• Host: localhost
Write a Python-MySQL program to change the Book_Title to 'Data Structures in
Python' for the record whose Book_ID is 109 in the book_records table.
m
m Section-E (2 X 5 = 10 Marks)
c. oA college administrator, Atul, maintains student course enrollmentsrecords.
m .co
36 e 2+3

s em Each record includes Roll_No, Student_Name, Course, Fees. a
g l
l a I. Input enrollment details and append them to a binary file.a
Write Python functions to:

ag II. Update the Fees of all students enrolled in the "Data Science" course to 75000.
37 AKA University is setting up its Academic blocks at Raipur and planning to set up a 5
network. The university has 3 academic blocks and one Human Resource Center as
shown in the diagram below:

m .
.co
s e m
s em l a
ag
pg. 7

g la
a For more Question Papers, Sample Papers, Notes & Syllabus visit Page 7 of 8

Page 9

Center to center distances between various blocks is as follows:

Law Block to Business Block 90 m
Law Block to Technology Block 55 m
Law Block to HR Center 120 m
Business Block to Technology Block 70 m
Business Block to HR Center 105 m
Technology Block to HR Center 45 m

Number of Computers in each of the Blocks/Center is as follows:

Law Block 30
Technology Block 55
HR Center 120
Business Block 45

I. Suggest the most suitable place (i.e. Block/Center) to install the server of this
university with a suitable reason.
II. Identify and draw the most suitable topology for connecting all the blocks if
the university wants a centralized network management system.
III. Suggest and placement of the following devices with reasons.
a. Repeater
b. Switch
IV. The Institute is planning to link its study center situated in Delhi. Suggest a
way to connect it with reasonably high speed guided medium.
V. A. The Vice-Chancellor wants to hold a face-to-face digital meeting with the
Heads of Departments in all blocks simultaneously. Which Protocol will be
used?
OR
B. What is the use of VoIP?

pg. 8

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

Document Details

Board / OrgCBSE
ExamClass 12
TypeSample Paper
Pages8
Updated29 Oct 2026