Class 12 CBSE Final Term Computer Science Question Bank
Class 12 CBSE Final Term Computer Science Question Bank
1. State True or False: Identifiers are names used to identify a variable, function in a program.
2. Which of the following is a valid keyword in Python?
(a) false (b) return (c) non_local (d) none
3. Given the following Tuple: Tup = (10, 20, 30, 50), which of the following statements will result in an error?
(a) print(Tup[0]) (b) Tup.insert(2,3) (c) print(Tup[1:2]) (d) print(len(Tup))
4. Consider the given expression: 5 < 10 and 12 > 7 or not 7 > 4. What will be the correct output if the given
expression is evaluated?
(a) True(b) False (c) NONE (d) NULL
5. Select the correct output of the following code:
S = "Amrit Mahotsav@ 75"
A = S.partition(" ")
print(A)
(a) (‘Amrit Mahotsav’, ‘@’, ’75’) (b) [‘Amrit’, ‘Mahotsav’, ‘@’, ’75’] (c) (‘Amrit’, ‘Mahotsav@ 75’)
(d) (‘Amrit’, ‘Mahotsav@ 75′, ’75’)
6. Which of the following mode keeps the file offset position at the end of the file?
(a) r+ (b) r (c) w (d) a
7. Which function is used to arrange the elements of a list in ascending order?
(a) sort() (b) arrange() (c) ascending() (d) asort()
8. Which of the following operators will return either True or False?
(a) += (b) != (c) = (d) *=
9. Which statement(s) would give an error after executing the following code.
Stud = {"Murugan": 100, "Mithu": 95}
print(Stud[95])
(a) Statement 2 (b) Statement 3 (c) Statement 4 (d) Statements 2 and 4
10. ___ is the number of tuples in a relation.
(a) Attribute (b) Degree (c) Domain (d) Cardinality
11. The syntax of seek() is: file object.seek(offset[, reference_point]). What is the default value of the reference point?
(a) 0 (b) 1 (c) 2 (d) 3
12. _____ clause is used with the SELECT statement to display data in a sorted form with respect to a specified column.
(a) WHERE (b) ORDER BY (c) HAVING (d) DISTINCT
13. ___ communication is used for point-to-point communication such as radar and satellite.
(a) INFRARED WAVES (b) BLUETOOTH (c) MICROWAVES (d) RADIOWAVES
14. What will the following expression evaluate to:
print(4 + 3 * 5 / 3 - 5 % 2)
(a) 8.5 (b) 8.0 (c) 10.2 (d) 10.0
15. Which function returns the sum of all elements of a list?
(a) count() (b) sum() (c) total() (d) add()
16. Assertion (A): To use a function from a particular module, we need to import the module.
Reason (R): import statement can be written anywhere in the program, before using a function from that module.
(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.
17. Assertion (A): A stack is a LIFO structure.
Reason (R): Any new element pushed into the stack always gets positioned at the index after the last existing element in the
stack.
(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.
Section B – Very Short Answer Questions (2 marks each)
1. Rewrite the following code to correct syntactical errors:
def max_num(L):
max = L(0)
for a in L:
if a > max:
max = a
return max
2. Differentiate between wired and wireless transmission.
3. Differentiate between URL and domain name with the help of an example.
4. Consider the Python list:
Listofnames = ["Aman", "Ankit", "Ashish", "Rajan", "Rajat"]
5. Explain the concept of “Alternate Key” in a Relational Database Management System with an example.
6. Write the full forms of:
(i) HTML
(ii) TCP
5. Write a function EOReplace() in Python which accepts a list of numbers and increments all even numbers by 1 and
decrements all odd numbers by 1.
Section D – Long Answer Questions (5 marks each)
1. Write a function Push_Cust() to push customer names staying in ‘Delux’ room type in a stack, and Pop_Cust() to pop and
display customer names.
2. An IT-based firm is planning to set up a network for its branches. Suggest an ideal layout to connect the branches and
justify your choice.
3. Write a program in Python that defines and calls the following user-defined functions:
COURIER_ADD(): Takes values from the user and adds them to a CSV file courier.csv.
COURIER_SEARCH(): Takes the destination as input and displays all the courier records going to that destination.
Section E – Internal Choice Questions (4 marks each)
1. The school has asked their estate manager Mr. Rahul to maintain the data of all the labs in a table LAB. Based on
the data, identify the columns which can be considered as Candidate keys and write the degree and cardinality of the
table.
2. Write a user-defined function write_bin() to create a binary file called Cust_file.dat and store customer
information (customer number, name, quantity, price, and amount).