This is the Class 12 CBSE Final Term Computer Science Question Bank. The students’ challenges are met through a set of questions and answers that cut across all topics. The questions are divided into sections including multiple choice, very short answer, short answer and long answer questions so as to enhance the revision. Detailed answers are interspersed in any patient section that can be disclosed. Use this question bank for revising the concepts, practicing important questions or preparing for the final examination.
Note: These questions are based on the latest syllabus updates and include previous year questions for reference. Ensure to reshow the solved examples provided to grasp complex topics with ease.
Section A – Multiple Choice Questions (1 mark each)
- State True or False: Identifiers are names used to identify a variable, function in a program.
- Which of the following is a valid keyword in Python?
- (a) false
- (b) return
- (c) non_local
- (d) none
- 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))
- 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
- 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’)
- Which of the following mode keeps the file offset position at the end of the file?
- (a) r+
- (b) r
- (c) w
- (d) a
- Which function is used to arrange the elements of a list in ascending order?
- (a) sort()
- (b) arrange()
- (c) ascending()
- (d) asort()
- Which of the following operators will return either True or False?
- (a) +=
- (b) !=
- (c) =
- (d) *=
- 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
- ___ is the number of tuples in a relation.
- (a) Attribute
- (b) Degree
- (c) Domain
- (d) Cardinality
- 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
- ___ 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
- ___ communication is used for point-to-point communication such as radar and satellite.
- (a) INFRARED WAVES
- (b) BLUETOOTH
- (c) MICROWAVES
- (d) RADIOWAVES
- 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
- Which function returns the sum of all elements of a list?
- (a) count()
- (b) sum()
- (c) total()
- (d) add()
fetchall()
method fetches all rows in a result set and returns a:- (a) Tuple of lists
- (b) List of tuples
- (c) List of strings
- (d) Tuple of strings
- 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.
- 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)
- 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
- Differentiate between wired and wireless transmission.
- Differentiate between URL and domain name with the help of an example.
- Consider the Python list:
Listofnames = ["Aman", "Ankit", "Ashish", "Rajan", "Rajat"]
Write the output of:
print(Listofnames[-1::-4:-1])
- Explain the concept of “Alternate Key” in a Relational Database Management System with an example.
- Write the full forms of:
- (i) HTML
- (ii) TCP
- Write the output of the following code:
subject = ['CS', 'HINDI', 'PHYSICS', 'CHEMISTRY', 'MATHS'] short_sub(subject, 5) print(subject)
Section C – Short Answer Questions (3 marks each)
- Differentiate between CHAR and VARCHAR data types in SQL with an example.
- Consider the following tables – LOAN and BORROWER. How many rows and columns will be there in the natural join of these two tables?
- Write a Python function
LongLines()
that reads the contents of a text file and displays lines with at least 10 words. - Write the SQL queries for:
- SELECT MIN(PRICE), MAX(PRICE) FROM COMPUTER;
- SELECT COMPANY, COUNT(*) FROM COMPUTER GROUP BY COMPANY HAVING COUNT(COMPANY) > 1;
- 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)
- Write a function
Push_Cust()
to push customer names staying in ‘Delux’ room type in a stack, andPop_Cust()
to pop and display customer names. - 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.
- 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 filecourier.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)
- 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.
- Write a user-defined function
write_bin()
to create a binary file calledCust_file.dat
and store customer information (customer number, name, quantity, price, and amount).
Disclaimer
The question bank provided on this website is meant to be a supplementary resource for final term exam preparation. While we strive to offer accurate and relevant content, students should not rely solely on these answers. It is essential to conduct further research and consult teachers, school authorities, or subject experts to ensure thorough understanding and preparation. The solutions here are based on general interpretations and may not reflect the exact responses expected by examination boards. We are not responsible for any discrepancies or outcomes in exams resulting from the use of this material. By using this resource, you acknowledge that your academic success depends on comprehensive preparation, including active engagement with school materials and guidance from educators.