Commerce (English Medium)
Science (English Medium)
Arts (English Medium)
Academic Year: 2024-2025
Date & Time: 29th March 2025, 10:30 am
Duration: 3h
Advertisements
General Instructions:
- This question paper contains 37 questions.
- All questions are compulsory. However, internal choices have beenprovided in some questions. Attempt only one of the choices in such questions.
- The paper is divided into 5 Sections — A, B, C, D and E.
- Section A, consists of 21 questions (1 to 21). Each question carries 1 mark.
- Section B, consists of 7 questions (22 to 28). Each question carries 2 marks.
- Section C, consists of 3 questions (29 to 31). Each question carries 3 marks.
- Section D, consists of 4 questions (32 to 35). Each question carries 4 marks.
- Section E, consists of 2 questions (36 & 37). Each question carries 5 marks.
- All programming questions are to be answered using Python Language only.
- In case of MCQs, text of the correct answer should also be written.
State True or False:
A Python List must always contain all its elements of same data typе.
Chapter:
What will be the output of the following statement?
print(14%3**2*4)16
64
20
256
Chapter:
Identify the correct output of the following code snippet:
game="olympic2024"
print(game.index("C"))0
6
−1
ValueError
Chapter:
Which of the following is the correct identifier?
global
Break
def
with
Chapter:
Identify the invalid Python statement out of the following options:
print("A",10,end="*")print("A",sep="*",10)print("A",10,sep="*")print("A"*10)Chapter:
Consider the statements given below and then choose the correct output from the given options:
L=[‘TIC’, ‘TAC’]
print(L[::-1])[‘CIT’, ‘CAT’]
[‘TIC’, ‘TAC’]
[‘CAT’, ‘CIT’]
[‘TAC’, ‘TIC’]
Chapter:
Which of the following operator evaluates to True if the variable on either side of the operator points towards the same memory location and False otherwise?
is
is not
and
or
Chapter:
Consider the statements given below and then choose the correct output from the given options:
D={'S01':95, 'S02':96}
for I in D :
print(I,end='#')S01#S02#
95#96#
S01,95#S02,96#
S01#95#SO2#96#
Chapter:
While creating a table, which constraint does not allow insertion of duplicate values in the table?
UNIQUE
DISTINCT
NOT NULL
HAVING
Chapter:
Consider the statements given below and then choose the correct output from the given options:
def Change(N):
N=N+10
print (N,end=‘$$’)
N=15
Change(N)
print(N)25$$15
15$$25
25$$25
2525$$
Chapter:
Consider the statements given below and then choose the correct output from the given options:
N=‘5’
try:
print('WORD' + N, end='#')
except:
print('ERROR',end='#')
finally:
print('OVER')ERROR#
WORD5#OVER
WORD5#
ERROR#OVER
Chapter:
Which of the following built-in function/method returns a dictionary?
dict()
keys()
values()
items()
Chapter:
Which of the following is a DML command in SQL?
UPDATE
CREATE
ALTER
DROР
Chapter:
Which aggregate function in SQL displays the number of values in the specified column ignoring the NULL values?
len()
count()
number()
num()
Chapter:
In MYSQL, which type of value should not be enclosed within quotation marks?
DATE
VARCHAR
FLOAТ
CHAR
Chapter:
State True or False:
If table A has 6 rows and 3 columns, and table B has 5 rows and 2 columns, the Cartesian product of A and B will have 30 rows and 5 columns.
Chapter:
Which of the following networking devices is used to regenerate and transmit the weakened signal ahead?
Hub
Ethernet Card
Repeater
Modem
Chapter:
Advertisements
Which of the following options is the correct protocol used for phone calls over the internet?
PPP
FTP
HTTP
VoIP
Chapter:
Expand the following:
ARPANET
Chapter: [10] Computer Networks
Assertion (A): For a binary file opened using ‘rb’ mode, the pickle.dump() method will display an error.
Reason (R): The pickle.dump() method is used to read from a binary file.
Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation for Assertion (A).
Both Assertion (A) and Reason (R) are true and Reason (R) is not the correct explanation for Assertion (A).
Assertion (A) is true but, Reason (R) is false.
Assertion (A) is false but, Reason (R) is true.
Chapter:
Assertion (A): We can retrieve records from more than one table in MYSQL.
Reason (R): Foreign key is used to establish a relationship between two tables.
Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation for Assertion (A).
Both Assertion (A) and Reason (R) are true and Reason (R) is not the correct explanation for Assertion (A).
Assertion (A) is true but, Reason (R) is false.
Assertion (A) is false but, Reason (R) is true.
Chapter:
What does the return statement do in a function? Explain with the help of an example.
Chapter:
Write one example of the following in Python:
Syntax Error
Chapter:
Write one example of the following in Python:
Implicit Type Conversion
Chapter:
Consider the following dictionaries, D and D1:
D={"Suman":40, "Raj":55, "Raman":60}
D1={"Aditi":30, "Amit":90, "Raj":20}
(Answer using built-in Python functions only)
Write a statement to display/return the value corresponding to the key "Raj" in the dictionary D.
Chapter:
Consider the following dictionaries, D and D1:
D={"Suman": 40, "Raj":55, "Raman":60}
D1={"Aditi": 30, "Amit":90, "Raj":20}
(Answer using built-in Python functions only)
Write a statement to display the length of the dictionary D1.
Chapter:
Consider the following dictionaries, D and D1:
D={"Suman": 40, "Raj":55, "Raman":60}
D1={"Aditi":30, "Amit":90,"Raj":20}
(Answer using built-in Python functions only)
Write a statement to append all the key-value pairs of the dictionary D to the dictionary D1.
Chapter:
Consider the following dictionaries, D and D1:
D={"Suman": 40, "Raj":55, "Raman":60}
D1={"Aditi":30, "Amit":90,"Raj":20}
(Answer using built-in Python functions only)
Write a statement to delete the item with the given key “Amit” from the dictionary D1.
Chapter:
What possible output from the given options is expected to be displayed when the following code is executed?
import random
Cards=["Heart", "Spade", "Club", "Diamond"]
for i in range (2):
print(Cards[random.randint(1,i+2) ],end="#")
Spade#Diamond#
Spade#Heart#
Diamond#Club#
Heart#Spade#
Chapter:
The code given below accepts N as an integer argument and returns the sum of all integers from 1 to N. Observe the following code carefully and rewrite it after removing all syntax and logical errors. Underline all the corrections made.
def Sum(N)
for I in range(N):
S=S+I
return S
print(Sum(10)Chapter:
Nisha is assigned the task of maintaining the staff data of an organization. She has to store the details of the staff in the SQL table named EMPLOYEES with attributes as EMPNO, NAME, DEPARTMENT, BASICSAL to store Employee's Identification Number, Name, Department, and Basic Salary respectively. There can be two or more Employees with the same name in the organization. |
Help Nisha to identify the attribute which should be designated as the PRIMARY KEY. Justify your answer.
Chapter:
Nisha is assigned the task of maintaining the staff data of an organization. She has to store the details of the staff in the SQL table named EMPLOYEES with attributes as EMPNO, NAME, DEPARTMENT, BASICSAL to store Employee's Identification Number, Name, Department, and Basic Salary respectively. There can be two or more Employees with the same name in the organization. |
Help Nisha to identify the constraint which should be applied to the attribute NAME such that the Employees' Names cannot be left empty or NULL while entering the records but can have duplicate values.
Chapter:
Write the SQL command to change the size of the attribute BASICSAL in the table EMPLOYEES to allow the maximum value of 99999.99 to be stored in it.
Chapter:
Write the SQL command to delete the table EMPLOYEES.
Chapter:
Advertisements
Write a Python function that displays all the lines containing the word 'vote' from a text file "Elections.txt". For example, if the file contains:
In an election many people vote to choose their representative.
The candidate getting the maximum share of votes stands elected.
Normally, one person has to vote oncе.
The process of voting may vary with time and region.
Then the output should be:
In an election many people vote to choose their representative.
Normally, one person has to vote once.
Chapter:
Write a Python function that displays all the words starting and ending with a vowel from a text file “Report.txt”. The consecutive words should be separated by a space in the output. For example, if the file contains:
Once there was a wise man in a village.
He was an awesome story-teller.
He was able to keep people anchored while listening to him.
Then the output should be:
Once a awesome able.
Chapter:
A stack, named ClrStack, contains records of some colors. Each record is represented as a tuple containing four elements - ColorName, RED, GREEN, BLUE. ColorName is a string, and RED, GREEN, BLUE are integers. For example, a record in the stack may be (‘Yellow’, 237, 250, 68)
Write the following user-defined functions in Python to perform the specified operations on ClrStack:
push_Clr(ClrStack, new_Clr):This function takes the stack ClrStack and a new recordnew_Clras arguments and pushes this new record onto the stack.pop_Clr(ClrStack):This function pops the topmost record from the stack and returns it. If the stack is already empty, the function should display the message“Underflow".isEmpty(ClrStack):This function checks whether the stack is empty. If the stack is empty, the function should returnTrue, otherwise the function should returnFalse:
Chapter:
Write the following user-defined functions in Python:
push_trail(N,myStack):HereNandmystackare lists, andmyStackrepresents a stack. The function should push the last 5 elements from the listNonto the stackmyStack. For example, if the listNis[1,2,3,4,5,6,7], then the functionpush_trail()Should push the elements3, 4, 5, 6, 7onto the stack. Therefore the value of stack will be[3, 4, 5, 6, 7]. Assume thatNcontains at least 5 elements.- pop_one(myStack): The function should pop an element from the stack
myStack, and return this element. If the stack is empty, then the function should display the message‘Stack Underflow', and returnNone. display_all(myStack):The function should display all the elements of the stackmyStack, without deleting them. If the stack is empty, the function should display the message'Empty Stack'.
Chapter:
Predict the output of the following code:
def ExamOn (mystr):
newstr = ""
count = 0
for i in mystr:
if count%2 != 0:
newstr=newstr+str(count-1)
else:
newstr=newstr+i.lower()
count +=1
newstr=newstr+mystr[:2]
print("The new string is:", newstr)
ExamOn("GenX")Chapter:
Write the output on execution of the following Python code:
def Change (X):
for K,V in X.items():
Ll.append(K)
L2.append(V)
D={1:"ONE”,2:"TWO",3:"THREE"}
L1=[]
L2=[]
Change (D)
print (L1)
print (L2)
print (D).Chapter:
Suman has created a table named WORKER with a set of records to maintain the data of the construction sites, which consists of WID, WNAME, WAGE, HOURS, TYPE, and SITEID. After creating the table, she entered data in it, which is as follows:
| WID | WNAME | WAGE | HOURS | TYPE | SITEID |
W01 |
Ahmed J |
1500 |
200 |
Unskilled |
103 |
W11 |
Naveen S |
520 |
100 |
Skilled |
101 |
W02 |
Jacob B |
780 |
95 |
Unskilled |
101 |
W15 |
Nihal K |
560 |
110 |
Semiskilled |
NULL |
W10 |
Anju S |
1200 |
130 |
Skilled |
103 |
Based on the data given above, answer the following questions:
- Write the
SQLstatement to display the names and wages of those workers whose wages are between800and1500. - Write the
SQLstatement to display the record of workers whoseSITEIDis not known. - Write the SQL statement to display
WNAME, WAGEandHOURSof all those workers whoseTYPEis‘Skilled’. - Write the SQL statement to change the
WAGEto 1200 of the workers where theTYPE“Semiskilled”.
Chapter:
Suman has created a table named WORKER with a set of records to maintain the data of the construction sites, which consists of WID, WNAME, WAGE, HOURS, TYPE, and SITEID. After creating the table, she entered data in it, which is as follows:
| WID | WNAME | WAGE | HOURS | TYPE | SITEID |
W01 |
Ahmed J |
1500 |
200 |
Unskilled |
103 |
W11 |
Naveen S |
520 |
100 |
Skilled |
101 |
W02 |
Jacob B |
780 |
95 |
Unskilled |
101 |
W15 |
Nihal K |
560 |
110 |
Semiskilled |
NULL |
W10 |
Anju S |
1200 |
130 |
Skilled |
103 |
Considering the above given table WORKER, write the output on execution of the following SQL commands:
-
SELECT WNAME, WAGE*HOURS FROM WORKER WHERE SITEID = 103; -
SELECT COUNT (DISTINCT TYPE) FROM WORKER; -
SELECT MAX(WAGE), MIN(WAGE), TYPE FROM WORKER GROUP BY TYРЕ; -
SELECT WNAME, SITEID FROM WORKER WHERE TYPE="Unskilled" ORDER BY HOURS;
Chapter:
A csv file "P_record.csv" contains the records of patients in a hospital. Each record of the file contains the following data:
- Name of a patient
- Disease
- Number of days patient is admitted
- Amount:
For example, a sample record of the file may be: ["Gunjan","Jaundice",4,15000]
Write the following Python functions to perform the specified operations on this file:
- Write a function
read_data()which reads all the data from the file and displays the details of all the'Cancer'patients. - Write a function
count_rec()which counts and returns the number of records in the file.
Chapter:
Assume that you are working in the IT Department of a Creative Art Gallery (CAG), which sells different forms of art creations like Paintings, Sculptures etc. The data of Art Creations and Artists are kept in tables Articles and Artists respectively. Following are few records from these two tables:
Table: Articles |
||||
Code |
A_code |
Article |
Doc |
Price |
PL001 |
A0001 |
Painting |
2018-10-19 |
20000 |
SC028 |
A0004 |
Sculpture |
2021-01-15 |
16000 |
QL005 |
A0003 |
Quilling |
2024-04-24 |
3000 |
Table: Artists |
||||
A_Code |
Name |
Phone |
Email |
DOB |
A0001 |
Roy |
595923 |
[email protected] |
1986-10-12 |
A0002 |
Ghosh |
1122334 |
[email protected] |
1972-02-05 |
A0003 |
Gargi |
121212 |
[email protected] |
1996-03-22 |
A0004 |
Mustafa |
33333333 |
[email protected] |
2000-01-01 |
Note:
- The tables contain many more records than shown here.
- DOC is Date of Creation of an Article.
As an employee of CAG, you are required to write the SQL queries for the following:
- To display all the records from the
Articlestable in descending order of price. - To display the details of Articles which were created in the year
2020. - To display the structure of
Artiststable. -
- To display the name of all artists whose Article is
Paintingthrough Equi Join.
OR - To display the name of all Artists whose Article is
'Painting'through Natural Join.
- To display the name of all artists whose Article is
Chapter:
A table, named THEATRE, in CINEMA database, has the following structure:
Field |
Type |
Th_ID |
char (5) |
Name |
varchar (15) |
City |
varchar (15) |
Location |
varchar (15) |
Seats |
int |
Write a function Delete _Theatre (), to input the value of Th_ ID from the user and permanently delete the corresponding record from the table.
Assume the following for Python-Database connectivity:
Host: localhost, User: root, Password: Ex2025
Chapter:
A file, PASSENGERS.DAT, stores the records of passengers using the following structure:
[PNR, PName, BRDSTN, DESTN, FARE]
where:
PNR - Passenger Number (string type)
PName - Passenger Name (string type)
BRDSTN - Boarding Station Name (string type)
DESTN - Destination Station Name (string type)
FARE - Fare amount for the journey (float type)
Write user defined functions in Python for the following tasks:
Create()−to input data for passengers and write it in the binary filePASSENGERS.DAT.SearchDestn(D)-to read contents from the filePASSENGERS.DATand display the details of those Passengers whoseDESTNmatches with the value of D.UpdateFare()-to increase the fare of all passengers by 5% ad rewrite the updated records into the filePASSENGERS.DAT.
Chapter:
‘Swabhaav’ is a big NGO working in the field of Psychological Treatment and Counselling, having its Head Office in Nagpur. It is planning to set up a center in Vijayawada. The Vijayawada Center will have four blocks - ADMIN, PSYCHIATRY, PSYCHOLOGY, and ICU. You, as a Network Expert, need to suggest the best network-related solutions for them to resolve the issues/problems mentioned in questions (i) to (v), keeping the following parameters in mind:

Block to Block distances (in metres):
| From | To | Distance |
| ADMIN | PSYCHIATRY | 65 m |
| ADMIN | PSYCHOLOGY | 65 m |
| ADMIN | ICU | 65 m |
| PSYCHIATRY | PSYCHOLOGY | 100 m |
| PSYCHIATRY | ICU | 50 m |
| PSYCHOLOGY | ICU | 50 m |
Distance of Nagpur Head Office from Vijayawada Center = 700 km Number of Computers in each block is as follows:
| Block | No. of Computers |
| ADMIN | 16 |
| PSYCHIATRY | 40 |
| PSYCHOLOGY | 19 |
| ICU | 20 |
- Suggest the most appropriate location of the server inside the Vijayawada Center. Justify your choice.
- Which hardware device will you suggest to connect all the computers within each block of Vijayawada Center?
- Draw a cable layout to efficiently connect various blocks within the Vijayawada Center.
- Where should the router be placed to provide internet to all the computers in the Vijayawada Center?
- The Manager at Nagpur wants to remotely access the computer in Admin block in Vijayawada. Which protocol will be used for this?
OR - Which type of Network (PAN, LAN, MAN or WAN) will be set up among the computers connected with Vijayawada Center?
- The Manager at Nagpur wants to remotely access the computer in Admin block in Vijayawada. Which protocol will be used for this?
Chapter:
Other Solutions
Submit Question Paper
Help us maintain new question papers on Shaalaa.com, so we can continue to help studentsonly jpg, png and pdf files
CBSE previous year question papers Class 12 Computer Science (Python) with solutions 2024 - 2025
Previous year Question paper for CBSE Class 12 Computer Science (Python)-2025 is solved by experts. Solved question papers gives you the chance to check yourself after your mock test.
By referring the question paper Solutions for Computer Science (Python), you can scale your preparation level and work on your weak areas. It will also help the candidates in developing the time-management skills. Practice makes perfect, and there is no better way to practice than to attempt previous year question paper solutions of CBSE Class 12.
How CBSE Class 12 Question Paper solutions Help Students ?
• Question paper solutions for Computer Science (Python) will helps students to prepare for exam.
• Question paper with answer will boost students confidence in exam time and also give you an idea About the important questions and topics to be prepared for the board exam.
• For finding solution of question papers no need to refer so multiple sources like textbook or guides.
