Organisation : Central Board of Secondary Education (CBSE)
Class Name : 12th/HSC (Class XII)
Subject : Computer Science
Download : Sample Question Paper 2024-25
Website : https://cbseacademic.nic.in//SQP_CLASSXII_2024-25.html
CBSE Class XII Computer Science Sample Question Paper
Central Board of Secondary Education (CBSE) Class XII Computer Science Sample Question Paper 2024-25.
Related / Similar Question Paper : CBSE Class XII Chemistry Sample Question Paper 2024-25
1. State True or False:
The Python interpreter handles logical errors during code execution. (1)
2. Identify the output of the following code snippet:
text = “PYTHONPROGRAM”
text=text.replace(‘PY’,’#’)
print(text)
(A) #THONPROGRAM
(B) ##THON#ROGRAM
(C) #THON#ROGRAM
(D) #YTHON#ROGRAM
3. Which of the following expressions evaluates to False?
(A) not(True) and False
(B) True or False
(C) not(False and True)
(D) True and not(False)
4. What is the output of the expression?
country=’International’
print(country.split(“n”))
(A) (‘I’, ‘ter’, ‘atio’, ‘al’)
(B) [‘I’, ‘ter’, ‘atio’, ‘al’]
(C) [‘I’, ‘n’, ‘ter’, ‘n’, ‘atio’, ‘n’, ‘al’]
(D) Error
5. What will be the output of the following code snippet?
message= “World Peace”
print(message[-2::-2])
6. What will be the output of the following code?
tuple1 = (1, 2, 3)
tuple2 = tuple1
tuple1 += (4,)
print(tuple1 == tuple2)
(A) True
(B) False
(C) tuple1
(D) Error
7. If my_dict is a dictionary as defined below, then which of the following statements will raise an exception?
my_dict = {‘apple’: 10, ‘banana’: 20, ‘orange’: 30}
(A) my_dict.get(‘orange’)
(B) print(my_dict[‘apple’, ‘banana’])
(C) my_dict[‘apple’]=20
(D) print(str(my_dict))
8. What does the list.remove(x) method do in Python?
(A) Removes the element at index x from the list
(B) Removes the first occurrence of value x from the list
(C) Removes all occurrences of value x from the list
(D) Removes the last occurrence of value x from the list
9. If a table which has one Primary key and two alternate keys. How many Candidate keys will this table have?
(A) 1
(B) 2
(C) 3
(D) 4
10. Write the missing statement to complete the following code:
file = open(“example.txt”, “r”)
data = file.read(100)
____________________ #Move the file pointer to the
beginning of the file
next_data = file.read(50)
file.close()
11. State whether the following statement is True or False:
The finally block in Python is executed only if no exception occurs in the try block. (1)
12. What will be the output of the following code?
c = 10
def add():
global c
c = c + 2
print(c,end=’#’)
add()
c=15
print(c,end=’%’)
(A) 12%15#
(B) 15#12%
(C) 12#15%
(D) 12%15#
13. Which SQL command can change the degree of an existing relation? (1)
14. What will be the output of the query?
SELECT * FROM products WHERE product_name LIKE ‘App%’;
(A) Details of all products whose names start with ‘App’
(B) Details of all products whose names end with ‘App’
(C) Names of all products whose names start with ‘App’
(D) Names of all products whose names end with ‘App’
15. In which datatype the value stored is padded with spaces to fit the specified length.
(A) DATE
(B) VARCHAR
(C) FLOAT
(D) CHAR
16. Which aggregate function can be used to find the cardinality of a table?
(A) sum()
(B) count()
(C) avg()
(D) max()
17. Which protocol is used to transfer files over the Internet?
(A) HTTP
(B) FTP
(C) PPP
(D) HTTPS (1)
18. Which network device is used to connect two networks that use different protocols?
(A) Modem
(B) Gateway
(C) Switch
(D) Repeater
19. Which switching technique breaks data into smaller packets for transmission, allowing multiple packets to share the same network resources.
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): Positional arguments in Python functions must be passed in the exact order in which they are defined in the function signature.
Reasoning (R): This is because Python functions automatically assign default values to positional arguments.
21. Assertion (A): A SELECT command in SQL can have both WHERE and HAVING clauses.
Reasoning (R): WHERE and HAVING clauses are used to check conditions, therefore, these can be used interchangeably
Download CBSE Class XII Computer Science Sample Question Paper
Download Sample Question Paper Here : https://www.pdfquestion.in/uploads/pdf2025/43593-CS.pdf