CBSE Class 12 CS 083 Sample QP 2025-26 with Solution

CBSE Class 12 Computer Science (083) Sample Question Paper 2025-26 with Solution is a helpful resource for students preparing for their board exams. It is based on the latest CBSE syllabus and gives a clear idea of the exam pattern and question types. By practicing this sample paper, students can revise important topics like Python, SQL, Pandas, and networking in an easy way and feel more confident before the exam.

CBSE-Class-12-CS-083-Sample-Question-Paper-2025-26-with-Solution

This solved CBSE Class 12 CS 083 2025-26 Sample Paper includes simple and clear answers, making it easier for students to understand how to write correct answers in the exam. It is useful for quick revision, self-study, and improving speed and accuracy. Regular practice with such papers helps students manage time better and score good marks in the CBSE Class 12 Computer Science exam.

CBSE Class 12 CS 083 Sample QP 2025-26 with Solution

You can download the free PDF of this sample pre-board question paper from our website and start practicing today. Download Link available in last.

The Year-Wise CBSE Class 12 Computer Science (083) Pre-Board and Sample Question Papers with Solutions are provided at the bottom of this post.

CBSE Class 12 CS 083 Sample Question Paper Session (2025-26)

CBSE | DEPARTMENT OF SKILL EDUCATION
COMPUTER SCIENCE (SUBJECT CODE - 083)
Sample Question Paper (SQP) Solution for Class XII (Session 2025-2026)

Max. Time: 3 Hours
Max. Marks: 70

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

1. State if the following statement is True or False:
Using the statistics module, the output of the below statements will be 20:
import statistics
statistics.median([10, 20, 10, 30, 10, 20, 30])
Ans: True

2. What will be the output of the following code?
L = ["India", "Incredible", "Bharat"]
print(L[1][0] + L[2][-1])
a) IT
b) it
c) It 
d) iT

3. Consider the given expression:
print(19<11 and 29>19 or not 75>30)
Which of the following will be the correct output of the given expression?
a) True
b) False
c) Null
d) No output

4. In SQL, which type of Join(s) may contain duplicate column(s)?
Ans: Equi-Join or Cartesian Join

5. What will be the output of the following Python code?
str= "Soft Skills"
print(str[-3::-3])
a) lSf
b) Stkl
c) StKi
d) l

6. Write the output of the following Python code :
for k in range(7, 40, 6):
    print(k, end='-')
Ans: Error as unsupported operand type(s) for +: 'int' and ‘str'

7. What will be the output of the following Python statement:
print(10-3**2**2+144/12)
Ans: -59.0

8. Consider the given SQL Query:
SELECT department, COUNT(*) FROM employees HAVING COUNT(*) > 5 GROUP BY department;
Saanvi is executing the query but not getting the correct output. Write the correction.
Ans: SELECT department, COUNT(*) FROM employees GROUP BY department HAVING COUNT(*) > 5;

9. What will be the output of the following Python code?
try:
    x = 10 / 0
except ZeroDivisionError:
    print("Division by zero error!")
except Exception:
    print("Some other error!")
a) Division by zero error!
b) Some other error!
c) ZeroDivisionError
d) Nothing is printed

10. What will be the output of the following Python code?
my_dict = {"name": "Alicia", "age": 27, "city": "DELHI"}
print(my_dict.get("profession", "Not Specified"))
a) Alicia
b) DELHI
c) None
d) Not Specified

11. What possible output is expected to be displayed on the screen at the time of execution of the Python program from the following code?
import random
L = [10, 30, 50, 70]
Lower = random.randint(2, 2)
Upper = random.randint(2, 3)
for K in range(Lower, Upper + 1):
    print(L[K], end='@')
a) 50@70@
b) 90@
c) 10@30@50@
d) 10@30@50@70@

12. What will be the output of the following Python code?
i = 5
print(i, end='@@')
def add():
    global i
    i = i + 7
    print(i, end='##')
add()
print(i)
a) 5@@12##15
b) 5@@5##12
c) 5@@12##12
d)12@@12##12

13. Which SQL command can change the cardinality of an existing relation?
a) Insert
b) Delete
c) Both a) & b)
d) Drop

14. What is the output of the given Python code?
st='Waterskiing is thrilling!'
print(st.split("i"))
a) ['Watersk', 'ng ', 's thr', 'll', ‘ng!']
b) ['Watersk', '', 'ng ', 's thr', 'll', 'ng!']
c) ['Watersk', 'i', 'ng ', 's thr', 'll', ‘ng!']
d) Error

15. In SQL, a relation consists of 5 columns and 6 rows. If 2 columns and 3 rows are added to the existing relation, what will be the updated degree of a relation?
a) Degree: 7
b) Degree: 8
c) Degree: 9
d) Degree: 6

16. Which SQL command is used to remove a column from a table in MySQL?
a) UPDATE
b) ALTER
c) DROP
d) DELETE

17. ______ is a protocol used for retrieving emails from a mail server.
a) SMTP
b) FTP
c) POP3
d) PPP

18. Which of the following is correct about using a Hub and Switch in a computer network?
a) A hub sends data to all devices in a network, while a switch sends data to the specific device.
b) A hub sends data only to the devices it is connected to, while a switch sends data to all devices in a network.
c) A hub and switch function the same way and can be used interchangeably.
d) A hub and switch are both wireless networking devices.

19. Which of the following is used to create the structure of a web page?
a) CSS
b) HTML
c) JavaScript
d) FTP

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.

Q.20 Assertion (A): The expression (1, 2, 3, 4).append(5) in Python will modify the original sequence datatype.
Reason (R): The append() method adds an element to the end of a list and modifies the list in place.
Ans: d) A is False but R is True.

21. Assertion (A): A primary key must be unique and cannot have NULL values.
Reason (R): The primary key uniquely identifies each row in the table.
Ans: a) Both A and R are True and R is the correct explanation for A.

SECTION B

22. Explain the difference between explicit and implicit type conversion in Python with a suitable example.
Ans: Implicit Conversion: Python automatically converts one data type to another.
Example:
x = 10
y = 3.5
result = x + y # x is implicitly converted to float
Explicit Conversion: The user manually converts one data type to another using functions like int(), float().
Example:
x = "10"
y = int(x) # Explicit conversion from string to integer

OR

Explain the difference between break and continue statements in Python with a suitable example.
Ans: Break exits the loop entirely, while continue skips the current iteration and moves to the next one.
Example of break:
for i in range(5):
    if i == 2:
        break # Exits the loop
    print(i)
Output:
0
1
Example of continue:
for i in range(5):
    if i == 2:
        continue
    print(i)
Output:
0
1
3
4

23. The code provided below is intended to remove the first and last characters of a given string and return the resulting string. However, there are syntax and logical errors in the code. Rewrite it after removing all the errors. Also, underline all the corrections made.
def remove_first_last(str):
    if len(str) < 2:
        return str
    new_str = str[1:-2]
    return new_str
result = remove_first_last("Hello")
Print("Resulting string: " result)
Ans:
def remove_first_last(str):
    if len(str) < 2:
        return str
    new_str = str[1:-1]
    return new_str
result = remove_first_last("Hello")
print("Resulting string:", result)

24. (Answer using Python built-in methods/functions only):
I. Write a statement to find the index of the first occurrence of the substring "good" in a string named review.
Ans: index = review.find("good")
II. Write a statement to sort the elements of list L1 in descending order.
Ans: 1.sort(reverse=True)

OR

Predict the output of the following Python code:
text="Learn Python with fun and practice"
print(text.partition("with"))
print(text.count("a"))
Ans: ('Learn Python ', 'with', ' fun and practice')
3

25. Write a function remove_element() in Python that accepts a list L and a number n. If the number n exists in the list, it should be removed. If it does not exist, print a message saying "Element not found".
Ans:
def remove_element(L, n):
    if n in L:
        L.remove(n)
        print(L)
    else:
        print("Element not found")

OR

Write a Python function add_contact() that accepts a dictionary phone_book, a name, and a phone number. The function should add the name and phone number to the dictionary. If the name already exists, print "Contact already exists" instead of updating it.
Ans:
def add_contact(phone_book, name, number):
    if name in phone_book:
        print("Contact already exists")
    else:
        phone_book[name] = number
        print("Contact added successfully")

26. Predict the output of the Python code given below :
emp = {"Arv": (85000,90000),"Ria": (78000,88000),"Jay": (72000,80000),"Tia": (80000,70000)}
selected = []
for name in emp:
    salary = emp[name]
    average = (salary[0] + salary[1]) / 2
    if average > 80000:
        selected.append(name)
print(selected)
Ans: ['Arv', 'Ria']

27. Write suitable commands to do the following in MySQL.
I. View the table structure.
Ans: DESC table_name; OR DESCRIBE table_name;
II. Create a database named SQP.
Ans: CREATE database SQP;

OR

Differentiate between drop and delete query in SQL with a suitable example.
Ans: The DELETE query removes all the records or specific records from a table, preserving the table structure.
Example: DELETE FROM Employees WHERE EmployeeID = 5;
The DROP query removes the entire table or database along with its data.
Example: DROP TABLE Employees;

28. Define the following terms:
I. ModemA modem is a device that helps connect your computer or other devices to the internet. It converts digital signals from your device into analog signals that can travel through phone lines or other networks, and vice versa.
II. GatewayA gateway is a device that connects two different networks and helps them communicate with each other. It translates the data between different network types, allowing them to work together.

OR

I. Expand the following terms: HTTP and FTP
Ans: HTTP: Hypertext Transfer Protocol; FTP: File Transfer Protocol
II. Differentiate between web server and web browser.
Ans: A web server stores and delivers web pages to users over the internet. A web browser requests and displays these web pages on the user's device.

SECTION C

29. Write a Python function that displays the number of times the word "Python" appears in a text file named "Prog.txt".
Ans:
def count_python():
    count = 0
    with open("Prog.txt", 'r') as file:
        text = file.read()
        words = text.split()
        for word in words:
            if word.lower() == "python":
                count += 1
    print("The word Python appears", count, "times.")

OR

Write and call a Python function to read lines from a text file STORIES.TXT and display those lines which doesn’t start with a vowel (A, E, I, O, U) irrespective of their case.
Ans:
def display_non_vowel_lines():
    with open("STORIES.TXT", "r") as file:
        print("Lines that don't start with a vowel:")
        lines = file.readlines()
        for line in lines:
            if line[0].lower() not in 'aeiou':
                print(line)
display_non_vowel_lines()

30. A list containing records of products as
L = [("Laptop", 90000), ("Mobile", 30000), ("Pen", 50), ("Headphones", 1500)]
Write the following user-defined functions to perform operations on a stack named Product to:
I. Push_element() – To push an item containing the product name and price of products costing more than 50 into the stack.
Output: [('Laptop', 90000), ('Mobile', 30000), ('Headphones', 1500)]
Ans:
L = [("Laptop", 90000), ("Mobile", 30000), ("Pen", 50), ("Headphones", 1500)]
product = []
def Push_element(L):
    for i in L:
        if i[1] > 50:
            product.append(i)
    print(product)
II. Pop_element() – To pop the items from the stack and display them. Also, display "Stack Empty" when there are no elements in the stack.
Output:
('Headphones', 1500)
('Mobile', 30000)
('Laptop', 90000)
Stack Emply
Ans:
def Pop_element(product):
    while product:
        print(product.pop())
    else:
        print("Stack Empty")

31. Predict the output of the following Python code:
s1 = "SQP-25"
s2 = ""
i = 0
while i < 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]
    else:
        s2 = s2 + '^'
    i += 1
print(s2)
Ans: QP-^14

OR

Predict the output of the following Python code:
wildlife_sanctuary = ["Kaziranga", "Ranthambhore", "Jim Corbett", "Sundarbans", "Periyar", "Gir", "Bandipur"]
output = []
for sanctuary in wildlife_sanctuary:
    if sanctuary[-1] in 'aeiou':
        output.append(sanctuary[0].upper())
print(output)
Ans: ['K', 'R']

SECTION D

32. Consider the table SALES as given below:
sales_id customer_name product quantity_sold price
S001 John Doe Laptop 5 50000
S002 Jane Smith Smartphone 10 30000
S003 Michael Lee Tablet 3 15000
S004 Sarah Brown Headphones 7 2000
S005 Emily Davis Smartwatch 8 8000
S006 David Smartwatch 3 16000
S007 Mark Tablet 5 34000
Write the following queries:
I. To display the total quantity sold for each product whose total quantity sold exceeds 12.
Ans: SELECT Product, SUM(Quantity_Sold) FROM SALES GROUP BY Product HAVING SUM(Quantity_sold) > 12;
II. To display the records of SALES table sorted by Product name in descending order.
Ans: SELECT * FROM SALES ORDER BY Product DESC;
III. To display the distinct Product names from the SALES table.
Ans: SELECT DISTINCT Product FROM SALES;
IV. To display the records of customers whose names end with the letter 'e'.
Ans: SELECT * from SALES where Customer_Name like "%e";

OR

Predict the output of the following:
I. SELECT * FROM Sales where product='Tablet';
Ans:
sales_id customer name product quantity sold price
S003 Michael Lee Tablet 3 15000
S007 Mark Tablet 5 34000
II. SELECT sales_id, customer_name FROM Sales WHERE product LIKE 'S%';
Ans:
sales_id customer_name
S002 Jane Smith
S005 Emily Davis
S006 David
III. SELECT COUNT(*) FROM Sales WHERE product in ('Laptop', 'Tablet');
Ans:
COUNT(*)
3
IV. SELECT AVG(price) FROM Sales where product='Tablet';
Ans:
AVG(price)
24500.0000

33. Raj is the manager of a medical store. To keep track of sales records, he has created a CSV file named Sales.csv, which stores the details of each sale.
The columns of the CSV file are: Product_ID, Product_Name, Quantity_Sold and Price_Per_Unit.
Help him to efficiently maintain the data by creating the following user-defined functions:
I. Accept() – to accept a sales record from the user and add it to the file Sales.csv.
Ans:
import csv
def Accept():
    product_id = input("Enter Product ID: ")
    product_name = input("Enter Product Name: ")
    quantity_sold = int(input("Enter Quantity Sold: "))
    price_per_unit = float(input("Enter Price Per Unit: "))
    with open('Sales.csv', 'a', newline='') as file:
        writer = csv.writer(file)
        writer.writerow([product_id, product_name, quantity_sold, price_per_unit])
    print("Sales record added successfully.")
II. CalculateTotalSales() – to calculate and return the total sales based on the Quantity_Sold and Price_Per_Unit.
Ans:
def CalculateTotalSales():
    total_sales = 0.0
    with open('Sales.csv', 'r') as file:
        reader = csv.reader(file)
        for row in reader:
            total_sales += int(row[2]) * float(row[3])
    print("Total Sales is:", total_sales)

34. Pranav is managing a Travel Database and needs to access certain information from the Hotels and Bookings tables for an upcoming tourism survey. Help him extract the required information by writing the appropriate SQL queries as per the tasks mentioned below:
Table: Hotels
H_ID Hotel_Name City Star_Rating
1 Hotel1 Delhi 5
2 Hotel2 Mumbai 5
3 Hotel3 Hyderabad 4
4 Hotel4 Bengaluru 5
5 Hotel5 Chennai 4
6 Hotel6 Kolkata 4
Table: Bookings
B_ID H_ID Customer_Name Check_In Check_Out
1 1 Jiya 2024-12-01 2024-12-05
2 2 Priya 2024-12-03 2024-12-07
3 3 Alicia 2024-12-01 2024-12-06
4 4 Bhavik 2024-12-02 2024-12-03
5 5 Charu 2024-12-01 2024-12-02
6 6 Esha 2024-12-04 2024-12-08
7 6 Dia 2024-12-02 2024-12-06
8 4 Sonia 2024-12-04 2024-12-08
I. To display a list of customer names who have bookings in any hotel of 'Delhi' city.
Ans: SELECT Customer_Name FROM Hotels, Bookings WHERE Hotels.H_ID = Bookings.H_ID AND City = 'Delhi';
II. To display the booking details for customers who have booked hotels in 'Mumbai', 'Chennai', or 'Kolkata'.
Ans: SELECT Bookings.* FROM Hotels, Bookings WHERE Hotels.H_ID = Bookings.H_ID AND City IN ('Mumbai', 'Chennai', 'Kolkata');
III. To delete all bookings where the check-in date is before 2024-12-03.
Ans: DELETE FROM Bookings WHERE Check_In < '2024-12-03';
IV. (A) To display the Cartesian Product of the two tables.
Ans: SELECT * FROM Hotels, Bookings;

OR

(B) To display the customer’s name along with their booked hotel’s name.
Ans: SELECT Customer_Name, Hotel_Name FROM Hotels, Bookings WHERE Hotels.H_ID = Bookings.H_ID;

35. MySQL database named WarehouseDB has a product_inventory table in MySQL which contains the following attributes:
• Item_code: Item code (Integer)
• Product_name: Name of product (String)
• Quantity: Quantity of product (Integer)
• Cost: Cost of product (Integer)
Consider the following details to establish Python-MySQL connectivity:
• Username: admin_user
• Password: warehouse2024
• Host: localhost
Write a Python program to change the Quantity of the product to 91 whose Item_code is 208 in the product_inventory table.
Ans:
import mysql.connector
connection = mysql.connector.connect(
    host='localhost',
    user='admin_user',
    password='warehouse2024',
    database='WarehouseDB'
)
cursor = connection.cursor()
update_query = "UPDATE product_inventory SET Quantity = 91 WHERE Item_code = 208"
cursor.execute(update_query)
connection.commit()
print("Data updated successfully.")
cursor.close()
connection.close()

SECTION E

36. Mr. Ravi, a manager at a tech company, needs to maintain records of employees. Each record should include: Employee_ID, Employee_Name, Department and Salary.
Write the Python functions to:
I. Input employee data and append it to a binary file.
Ans:
import pickle
def append_data():
    with open("emp.dat", 'ab') as file:
        employee_id = int(input("Enter Employee ID: "))
        employee_name = input("Enter Employee Name: ")
        department = input("Enter Department: ")
        salary = float(input("Enter Salary: "))
        pickle.dump([employee_id, employee_name, department, salary], file)
    print("Employee data appended successfully.")
II. Update the salary of employees in the "IT" department to 200000.
Ans:
def update_data():
    updated = False
    employees = []
    with open("emp.dat", 'rb') as file:
        try:
            while True:
                employee = pickle.load(file)

                if employee[2] == "IT":
                    employee[3] = 200000
                    updated = True
                employees.append(employee)
        except EOFError:
            pass
    with open("emp.dat", 'wb') as file:
        for employee in employees:
            pickle.dump(employee, file)
    if updated:
        print("Salaries updated for IT department.")
    else:
        print("No employee found in the IT department.")

37. XYZNova Inc. is planning a new campus in Hyderabad while maintaining its headquarters in Bengaluru. The campus will have four buildings: HR, Finance, IT, and Logistics. As a network expert, you are tasked with proposing the best network solutions for their needs based on the following:
From To Distance (in meters)
HR Finance 50
HR IT 175
HR Logistics 90
Finance IT 60
Finance Logistics 70
IT Logistics 60
Number of Computers in Each Block:
Block Number of Computers
HR 60
Finance 40
IT 90
Logistics 35
I. Suggest the best location for the server in the Hyderabad campus and explain your reasoning.
Ans: Block IT should house the server as it has maximum number of computers.
II. Suggest the placement of the following devices:
a) Repeater b) Switch
Ans: a) Repeater is to be placed between Block IT to Block HR as distance between them is more than 100 metres.
b) Switch is to be placed in each and every building.
III. Suggest and draw a cable layout of connections between the buildings inside the campus.
Ans:
CBSE-Class-12-CS-083-Sample-Question-Paper-2025-26-with-Solution-a37
IV. The organisation plans to provide a high-speed link with its head office using a wired connection. Which of the cables will be most suitable for this job?
Ans: Optical Fibre
V. (A) What is the use of VoIP?
Ans: Voice over Internet Protocol (VoIP) is a technology that allows users to make phone calls and other communications over the Internet instead of a traditional phone line.
OR
(B) Which type of network (PAN, LAN, MAN, or WAN) will be formed while connecting the Hyderabad campus to Bengaluru Headquarters?
Ans: WAN will be formed.

Download Now - Class 12 CS 083 Sample Question Paper 2025-26 with Solution

download-class-12-cs-083-sample-pre-board-question-paper-with-solution

Year wise Pre-Board and CBSE Sample Question Papers with Solution – Class 12 Computer Science (Code 083)

CBSE Class 12 CS 083 Sample QP 2026-27 with Solution

CBSE Class 12 CS 083 Sample QP 2025-26 with Solution

CBSE Class 12 CS 083 Sample QP 2024-25 with Solution

CBSE Class 12 CS 083 Additional Sample QP 2023-24 with Solution

CBSE Class 12 CS 083 Sample QP 2023-24 with Solution

CBSE Class 12 CS 083 Sample QP 2022-23 with Solution

CBSE Class 12 CS 083 Sample QP 2021-22 Term 2 with Solution

CBSE Class 12 CS 083 Sample QP 2021-22 Term 1 with Solution

CBSE Class 12 CS 083 Sample QP 2020-21 with Solution

Post a Comment

Previous Post Next Post