Class 12 CS 083 Sample Pre-Board QP 2026 with Solution

class-12-cs-083-sample-pre-board-qp-2026-with-solution

Preparing for the Class 12 Computer Science (Code 083) board examination becomes much easier when students practice with high-quality Class 12 CS sample papers. To help learners score excellent marks, we have shared CBSE-pattern Sample Paper and Pre-Board Sample Paper along with complete, step-by-step solutions.

Why This Sample Paper Is Important for Class 12 CS Students?

Class 12 Computer Science sample paper with solutions helps students:

  • Understand the exact question paper format
  • Get familiar with important topics like Python, Data Handling, SQL, Computer Networks, Boolean Algebra, and Database Management
  • Improve speed and accuracy through real exam-type practice
  • Analyse mistakes using detailed solutions
  • Build confidence for school pre-boards and final board exams
  • Strengthen conceptual clarity with well-explained answers

Whether a student is preparing for pre-boards or revising for final boards, these solved papers act as a powerful revision tool.

CBSE Class 12 CS 083 Sample Pre-Board Question Paper 2026 with Solution

SAMPLE PRE-BOARD QUESTION PAPER – SET 1 (THEORY)
CLASS: XII SESSION: 2025-26
COMPUTER SCIENCE (083)

Time allowed: 3 Hours
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.

1. State True or False:
chr() function returns the ASCII code of the character”.

Ans: False

2. Identify the output of the following code snippet:

M=['The', 'God', 'of', 'small', 'things']
print(M[3][2:]*len(M[1]))

a) ofofof
b) allallall
c) mallmallmall
d) smallsmall

3. What is the output of the given expression?
>>> -1<False or not 3 and 4

Ans: True

4. In SQL, which among the following is not DDL command?
a) ALTER
b) CREATE
c) UPDATE
d) DROP

5. What will be the output of the following Python code?

s="so many books so little time"
K=s.split('so')
print(K)


a) [”, ‘ many books ‘, ‘ little time’]
b) [‘ many books ‘, ‘ little time’]
c) [‘many books’, ‘little time’]
d) [‘many’, ‘books’, ‘little’, ‘time’]

6. Write the correct output of the following code:

i=2
while True>i:
	print(i)
	i=i-2
else:
	print("normal exit")

a) 2
b) 0
c) normal exit
d) False

7. What is the output of the given expression?
print(2//18%4**2+3)

a) 6
b) 12
c) 4
d) 3

8. Consider the given SQL query in MYSQL:
SELECT stream FROM student WHERE gender=”F”;
Sumit wants to display the stream name without any duplicate value. Write the corrected query.

Ans: SELECT DISTINCT stream FROM student WHERE gender=”F”;

9. What will be output of the following python code?

try:
	z=3+'a'
except ValueError:
	print("Value Error")
except TypeError:
	print("Type Error")

a) Value Error
b) Type Error
c) 3a
d) Index Error

10. What will be output of the following python code?
D={"Amit":85, "Ayesha":68, "Mayank":80, "Tara":90}
R=D.setdefault("Mayank", 70)
print(R)

a) ‘Mayank’
b) 70
c) 80
d) Error

11. What possible output(s) is/are expected to be displayed on the screen at the time of execution of the Python program from the following code?

import random
z=[3,8,7,9]
a=random.randint(1,2)
for i in range(a, len(z)):
	print(z[i], end='#')

a) 3#8#7#
b) 8#7#
c) 8#7#9#
d) 7#9#

random.randint(1,2) will generate either 1 or 2.
So two possible outputs are:
Case 1: If a = 1
Loop runs from index 1 to 3 (i.e., 1, 2, 3)
Values will be:
z[1] → 8
z[2] → 7
z[3] → 9
Output: 8#7#9#
Case 2: If a = 2
Loop runs from index 2 to 3 (i.e., 2, 3)
Values will be:
z[2] → 7
z[3] → 9
Output: 7#9#

12. What will be the output of the following code?

p=32
def display():
	global p
	p=p%5
	print(p, end='*')
display()
print(p) 

a) 32*2
b) 32*32
c) 2*32
d) 2*2

13. Fill in the blanks:
An attribute which establishes connection between two tables and it is primary key in another table is known as ______.

Ans: Foreign Key

14. What is the output of the given expression?
s="everything you can imagine is real"
Y=s.partition('in')
print(Y)

a) (‘everyth’, ‘in’, ‘g you can imagine is real’)
b) (‘everyth’, ‘in’, ‘g you can imag’, ‘in’, ‘e is real’)
c) [‘everyth’, ‘g you can imag’, ‘eis real’]
d) [‘everyth’, ‘in’, ‘g you can imagine is real’]

15. The degree and cardinality of a table named GAME are 4 and 6, respectively. The degree and cardinality of another table named SPORTS are 5 and 3, respectively. There is one common field in both tables. After performing the Cartesian product of both tables, what will be the new degree and cardinality of the resultant table?
a) 9 and 9
b) 20 and 9
c) 9 and 18
d) 20 and 18

16. Which SQL command is used to add a new attribute in a table in MySQL?
a) UPDATE
b) INSERT
c) ALTER
d) CREATE

17. Which of the following devices is essential to set up a wired LAN?
a) Modem
b) NIC
c) Repeater
d) Firewall

18. ______ is used for point-to-point communication or unicast communication such as radar and satellite.
a) Bluetooth
b) Infrared
c) Radio waves
d) Microwaves

19. Which network device serves as the entry and exit point of a network, as all data coming in or going out of a network must first pass through it?
a) Gateway
b) Modem
c) Switch
d) Repeater

Q.20 and Q.21 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): The Pandas library in Python is primarily used for creating static, animated and interactive 2D plots or figures.
Reason (R): Data visualization can be achieved with the help of a variety of charts and plots, including static plots, animations, and interactive visualizations.
Ans: b) Both A and R are true and R is not the correct explanation for A

21. Assertion (A): The SUBSTR() function extracts a portion of a string based on starting position and length.
Reason (R): The starting position in SUBSTR() begins from 0 in SQL.

Ans: d) A is False but R is True

SECTION B (7X2=14 Marks)

22. A. Write difference between = and == in Python. Give suitable example of each.

OR

Define dynamic data typing in python. Write an example to illustrate your answer.
Ans: It allows variables to hold values of different data types during the program execution.
Example:
x = 10 # x is an integer
x = “Hello” # Now x is a string

23. The code provided below is intended to calculate sum of odd numbers in a list. However, there are syntax and logical errors in the code. Rewrite the code in python after removing all error(s). Underline each correction done in the code.

def Sum-Odd():
	numbers = [13,8,15,20]
	total = 0
	for val in numbers():
		if val%2==0:
			total = total + val
			print(total)
Sum_Odd()
def Sum_Odd():
	numbers = [13,8,15,20]
	total = 0
	for val in numbers:
		if val%2!=0:
			total = total + val
	print(total)
Sum_Odd()

24. A. (Answer using Python built-in methods/functions only):
i) Write a statement to remove the key “age” from a dictionary named student.

ii) Write a statement to return the largest value from an integer list named nums.

OR

B. Predict the output of the following Python code:
msg="Buildathon Hackathon"
print(msg.replace("th", "j"))
print(msg.index("a"))

25. A. Write a function remove_duplicates() in Python that accepts a list L and returns a new list containing only the unique elements from L, after removing the duplicates.

OR

B. Write a Python function update_score() that accepts a dictionary named scores, a player name and a new score. If the player name already present in dictionary, update the score, otherwise, display the message “Player not found”.

26. Predict the output of the Python code given below:

data={"Jan":4300,"Feb":2800,"Mar":5600,"Apr":4000}
high=[]
for month, sale in data.items():
	if sale > 4100:
		high.append(month)
print(sorted(high, reverse=True))

27. A. Write suitable commands to do the following in MySQL.
i) To access /Enter in the database named Education

ii) Delete / remove a database named Tourism.

OR

B. Write difference between WHERE and HAVING clause with suitable example.

28. A. Define the following terms:
i) Bandwidth

ii) Router

OR

B. i) Expand the following terms: VoIP and SMTP

ii) Differentiate between Circuit Switching and Packet switching.

SECTION C (3X3=9 Marks)

29. Write a function CountDigits( ) in python which reads the content of a text file “KVSRESULT.TXT” and counts number of digits present in the text file.
Example:
If the contents in “MyData.TXT” are as follows:
“KVS students will deliver a 100% pass result in AISSCE-2026.”
The output of the function should be:
No. of digits are: 7

OR

Write a function Max_Vowels() in Python to display the line which has the maximum number of vowels from a text file, "NOVEL.TXT".

30. Consider a dictionary named Books which contains name of books as key and price as value.
Write the following user defined functions in python and perform the specified operations on a stack named Book_Name.
i) Push_BName(): It checks price of the book from the dictionary Books and pushes name of such books which have price more than 350 rupees, into the stack, Book_Name.
ii) Pop_BName(): It deletes the name of books from stack Book_Name and displays them. The function should also display “Stack is Empty” message when there is no more book left in the stack.
For example:
If the dictionary Books contains the following data:
Books={“Physics”:550,“Maths”:300,“Chem”:480,“Hindi”:250,“CS”:360,“English” :310}
After execution of Push_BName(), the stack Book_Name should have:
[“Physics”,“Chem”,“CS”]
and on execution of Pop_BName(), the following output should be displayed:
CS
Chem
Physics
Stack is Empty

31. A. Predict the output of the following code:

P=[1,9,4,6]
P.insert(2,3)
P.extend([8, 5])
print(P)
print(P.append([2,3]))
print(P[::2])

OR

B. Write the output of the code given below:

s1="AI Vidyasetu 1.0"
s2=""
for i in range(len(s1)):
	if s1[i]>='0' and s1[i]<='9':
		Num=int(s1[i])
		Num+=1
		s2=s2+str(Num)
	elif s1[i]>='A' and s1[i]<='Z':
		s2=s2+s1[i-1].lower()
	elif s1[i]>='a' and s1[i]<='z':
		s2=s2+s1[i+1].upper()
	else:
		s2=s2+'@'
print(s2)

SECTION D (4X4=16 Marks)

32. Consider a table VBB as given below: Table- VBB

School_CodeMentorGenderNo_of_teamsThemeSubmission_date
729AnujM2Atmanirbhar Bharat2025-10-23
888SudhirM1Vocal for local2025-11-07
988ManishM12Vocal for local2025-11-05
1007JatinderF3Samriddh Bharat2025-10-31
1100SangeetaF4Atmanirbhar Bharat2025-10-18
987NaveenM10Vocal for local2025-11-02
858MeenalF6Swadeshi2025-10-20
1011ZoyaF4Samriddh Bharat2025-11-03
1099SagarM8Swadeshi2025-10-28

A) Write the following queries:
i) Display name of theme and total teams registered under each theme.

ii) Display School code, theme name and number of teams of those themes whose name starts with the alphabet letter ‘V’.

iii) Display school code, mentor name and theme of those teams whose submission date is NULL.

iv) Count the total number of teams registered by female mentors under the theme “Samriddh Bharat”.

OR

B) Write the output:
i) Select Mentor, No_of_teams from VBB Where submission_date< ‘2025-10-31’ order by No_of_teams;

ii) Select Gender, min(No_of_teams) from VBB group by Gender;

iii) Select Mentor, Theme, Submission_date from VBB where no_of_teams <>8 and Theme= “swadeshi”;

iv) Select DISTINCT Theme, submission_date from VBB where submission_date>= “2025-11-01”;

33. Ms. Mamta is a python programmer dealing with a furniture business. She has to develop a simple inventory management system of all furniture data of her business. She has created a csv file named furdata.csv, to store the details of furniture. The structure of furdata.csv is:
[F_ID, FNAME, FPRICE]

Ms. Mamta wants to write a Program in Python that defines and calls the following user defined functions:
i) add() – To accept and add data of a furniture to a CSV file ‘furdata.csv’.

ii) search() – To display the records of the furniture which has price more than 10000.

34. Assume that you are working for the Department of Agriculture (DOA). The DOA maintains data of various crops grown in different regions and the farmers who cultivate them. The data is stored in two tables – CROP and FARMER. Following are a few records from these two tables of AGRICULTURE database.

 Table: CROP
+---------+------------+---------+---------------+--------------+
| Crop_ID | Crop_Name  | Season  | Area_Hectares | Yield_Tonnes |
+---------+------------+---------+---------------+--------------+
|   101   | Wheat      | Rabi    |     250.50    |     400.00   |
|   102   | Rice       | Kharif  |     300.00    |     500.00   |
|   103   | Maize      | Kharif  |     180.00    |     250.00   |
|   104   | Barley     | Rabi    |     100.00    |     150.00   |
|   105   | Sugarcane  | Annual  |     350.00    |     600.00   |
+---------+------------+---------+---------------+--------------+
 Table: FARMER
+------------+--------------+---------+------------+---------+
| Farmer_ID  | Farmer_Name  | Village | Contact_No | Crop_ID |
+------------+--------------+---------+------------+---------+
|      1     | Ram Singh    | Rampur  | 9876543210 |   101   |
|      2     | Mohan Lal    | Sehore  | 9898989898 |   102   |
|      3     | Ramesh       | Rampur  |    NULL    |   103   |
|      4     | Sita Devi    | Bhopal  | 9012345678 |   101   |
|      5     | Gopal        | Indore  | 9023456789 |   104   |
|      6     | Kiran Patel  | Ujjain  | 9001234567 |   105   |
+------------+--------------+---------+------------+---------+
Note : The tables contain many more records than shown here.

As a Database Administrator of DOA, you are required to write SQL queries for the following:
i) Display farmer name and crop name which they cultivate in “Kharif” season.

ii) Display name of those crops which are cultivated by the farmers who live in Rampur village.

iii) Display the crop name and number of farmers cultivating it, but only for crops cultivated by more than one farmer.

iv) A. To count total number of records, present in Farmer table.

OR

B. To delete the records of those farmers whose contact number is not known.

35. Sarika has created a table named FEES in the SCHOOLDB database in MySQL, which has the following structure:

FieldTypeDescription
Admn_NointAdmission Number
Snamevarchar(25)Student Name
ClassintClass of student
Amountfloat(6,2)Fee Amount
Statusvarchar(20)Paid / Unpaid

Write a user defined function UPDATE_FEES() in python to change the fee status to ‘PAID’ for all students whose fee amount is greater than or equal to 20000 using Python-MySQL database connectivity.
Assume the following for Python-Database connectivity:
host: localhost, user: root, password: preboard

SECTION E (2X5=10 Marks)

36. “KheloSports Pvt Ltd” is a sports management company that maintains a digital database of players in various sports. The company uses a binary file named “PLAYER.DAT” to store player information efficiently. The file contains records in the given format:
{player_id : [pname, age]}
Write the user-defined functions in pythons to perform the following actions:

i) Add_Data(): Take data of 5 players and write it into a binary file.

ii) Delete_Record(): Remove the records of those players whose age is less than 18 years from the file “PLAYER.DAT”.

37. “Tech Innovators” is planning to set up its India campus at Pune with its Head Office at Jaipur. The Pune campus has 4-main blocks-Innovation, Sales, Data Analytics and Admin. You as a network expert have to suggest the best network related solutions for their problems raised in (i) to (v).

class-12-cs-083-sample-pre-board-qp-2026-with-solution

Distance between various building blocks:

Innovation block to Sales block130 m
Innovation block to Data Analytics block95 m
Innovation block to Admin block60 m
Admin block to Data Analytics block50 m
Admin block to Sales block125 m
Pune campus to Head office1202 KM
Data Analytics to sales block55 m

Number of computers in each block:

Innovation block20
Sales block10
Data Analytics60
Admin25

i) Suggest the most appropriate location of the server inside the Pune campus (out of the 4 blocks), to get the best connectivity for maximum number of computers. Justify your answer.

ii) Suggest network type (out of LAN, MAN, WAN) for connecting each of the following set of their offices:
a) Pune Campus and Head Office
b) Admin block and sales block

iii) Suggest the placement of the following devices at Pune Campus:
a) Switch b) Repeater

iv) Company wants to connect its local offices situated in Pune. Company can compromise with speed but cost of connectivity should be economic. Which of the following communication medium, you will suggest to be procured by the company:

  • Telephone cable
  • Twisted Pair Cable
  • Optical Fiber Cable

v) A. Which of the following will you suggest to establish the online face-to-face communication between the people in the Admin office of Pune Campus and Jaipur Head office?
a) Cable TV
b) E-mail
c) Video Conferencing
d) Text Chat

OR

B. Suggest and draw the cable layout to efficiently connect various blocks within the Pune campus for connecting the computers.

FAQs – Class 12 Computer Science (083) Sample Paper

  1. Is this sample paper based on the latest CBSE Class 12 syllabus?

Yes, the sample paper is fully updated as per the latest CBSE syllabus and exam pattern for the current academic session.

  1. Does this sample paper include solutions?

Absolutely. The PDF includes detailed, step-by-step solutions following the official CBSE marking scheme.

  1. Are Python programming questions covered?

Yes. The paper includes Python coding questions, output-based questions, logic-based programs, and file handling questions with solutions.

  1. Will this help in pre-board exam preparation?

Yes. This sample paper is ideal for pre-boards and helps students practice real-exam style questions.

  1. Does the sample paper include SQL and Database questions?

Yes, SQL queries, output-based questions, joins, and DBMS questions are included.

  1. Can students score 90+ by practicing these sample papers?

Practice makes a huge difference. With consistent practice, understanding solutions, and revising concepts, students can definitely aim for 90+ marks.

  1. Is it useful for last-minute revision?

Yes. The solved sample paper provides quick revision and helps students analyze important topics quickly.

Sharing is caring – pass it on!

Post Comment

You May Have Missed