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 review the solved examples provided to grasp complex topics with ease.
- Question: Write the names of any four data types available in Python.
- Question: Name the Python Library modules which need to be imported to invoke the following functions:
- (i)
sqrt()
- (ii)
start()
(This might refer to another function)
- (i)
- Question: Rewrite the following code in Python after removing all syntax errors:
250 = Number WHILE Number <= 1000: if Number => 750: print Number Number = Number + 100 else: print Number * 2 Number = Number + 50
- Question: Find and write the output of the following Python code:
Msg1 = "WeLcOME" Msg2 = "GUeSTs" Msg3 = "" for I in range(0, len(Msg2) + 1): if Msg1[I] >= "A" and Msg1[I] <= "M": Msg3 = Msg3 + Msg1[I] elif Msg1[I] >= "N" and Msg1[I] <= "Z": Msg3 = Msg3 + Msg2[I] else: Msg3 = Msg3 + "*" print(Msg3)
- Question: Write four features of object-oriented programming.
- Question: Write the output of the following Python code:
class Box: L = 10 Type = "HARD" def __init__(self, T, TL=30): self.Type = T self.L = TL def Disp(self): print(self.Type, Box.Type) print(self.L, Box.L) B1 = Box("SOFT", 20) B1.Disp() Box.Type = "FLEXI" B2 = Box("HARD") B2.Disp()
- OR: Write the output of the following Python code:
class Target: def __init__(self): self.X = 20 self.Y = 24 def Disp(self): print(self.X, self.Y) def __del__(self): print("Target Moved") def One(): T = Target() T.Disp() One()
- Question: Define a class HOUSE in Python with the following specifications:
- Instance Attributes: Hno, Nor, Type
- Methods/Functions:
AssignType()
: Assigns house type based on NorEnter()
: Allows user input for Hno and NorDisplay()
: Displays the house details
- Question: Show the first, second, and third pass of selection sort for the list:
106, 104, 106, 102, 105, 10
- OR: Show the first, second, and third pass of bubble sort for the list:
106, 104, 106, 102, 105, 107
- Question: Write a Python function to count how many times the value
Val
is present in the listID
.ID = [115, 122, 137, 110, 122, 113] Val = 122
- OR: Write Python methods for queue operations
QueueUp()
to add a client andQueueDel()
to delete a client. - Question: Write the SQL queries to:
- (i) Display details of all Trains which Start from New Delhi.
- (ii) Display the PNR, PNAME, GENDER, and AGE of all Passengers whose AGE is below 50.