Commerce (English Medium)
Science (English Medium)
Arts (English Medium)
Academic Year: 2023-2024
Date: March 2024
Duration: 3h
Advertisements
General Instructions:
- This question paper contains 35 questions.
- The paper is divided into 4 Sections- A, B, C, D and E.
- Section A consists of 18 questions (1 to 18). Each question carries 1 Mark.
- Section B consists of 7 questions (19 to 25). Each question carries 2 Marks.
- Section C consists of 5 questions (26 to 30). Each question carries 3 Marks.
- Section D consists of 2 questions (31 to 32). Each question carries 4 Marks.
- Section E consists of 3 questions (33 to 35). Each question carries 5 Marks.
- All programming questions are to be answered using Python Language only.
“In a Python program, if a break statement is given in a nested loop, it terminates the execution of all loops in one go.”
True
False
Chapter: [0.01] Exceptional Handling in Python
In a table in the MYSQL database, an attribute A of datatype varchar(20) has the value “Keshav”. The attribute B of datatype char(20) has the value “Meenakshi”. How many characters are occupied by attribute A and attribute B?
20,6
6,20
9,6
6,9
Chapter: [0.09] Structured Query language (SQL)
What will be the output of the following statement:
print(3-2**2**3+99/11)
244
244.0
-244.0
Error
Chapter: [0.01] Exceptional Handling in Python
Select the correct output of the code:
s = "Python is fun"
l = s.split()
s_new = "_".join([1[0].upper(), 1[1], 1[2].capitalize()])
print(s_new)
PYTHON-IS-Fun
PYTHON-is-Fun
Python-is-fun
PYTHON-IS -Fun
Chapter: [0.01] Exceptional Handling in Python
In MYSQL database, if a table, Alpha has degree 5 and cardinality 3, and another table, Beta has degree 3 and cardinality 5, what will be the degree and cardinality of the Cartesian product of Alpha and Beta?
5, 3
8, 15
3, 5
15, 8
Chapter: [0.09] Structured Query language (SQL)
Riya wants to transfer pictures from her mobile phone to her laptop. She uses Bluetooth Technology to connect two devices. Which type of network will be formed in this case?
PAN
LAN
MAN
WAN
Chapter:
Which of the following will delete key-value pair for key = “Red” from a dictionary D1?
delete D1("Red")
del D1["Red"]
del.D1["Red"]
D1.del["Red"]
Chapter: [0.08] Database Concepts
Consider the statements given below and then choose the correct output from the given options:
pride="#G20 Presidency"
print(pride[-2:2:-2])
ndsr
ceieP0
ceieP
yndsr
Chapter:
Which of the following statement(s) would give an error during the execution of the following code?
tup = (20, 30, 40, 50, 80, 79)
print(tup) #Statement 1
print(tup[3] + 50) #Statement 2
print(max(tup)) #Statement 3
tup[4]=80 #Statement 4
Statement 1
Statement 2
Statement 3
Statement 4
Chapter: [0.08] Database Concepts
What possible outputs(s) will be obtained when the following code is executed?
import random
myNumber=random.randint (0, 3)
COLOR=["YELLOW", "WHITE", "BLACK", "RED"]
for I in range (1, myNumber) :
print (COLOR [I], end="*")
print ()
RED*
WHITE*
BLACK*
WHITE*
BLACK*
WHITE*WHITE*
BLACK*BLACK*
YELLOW*
WHITE*WHITE*
BLACK*BLACK*BLACK*
Chapter: [0.01] Exceptional Handling in Python
The modem at the sender’s computer end acts as a ______.
Model
Modulator
Demodulator
Convertor
Chapter: [0.05] Python - Communication Technologies [0.1] Computer Networks
Consider the code given below:
b=100
def test(a):
______________ # missing statement
b=b+a
print (a,b)
test (10)
print (b)
Which of the following statements should be given in the blank for #Missing Statement, if the output produced is 110?
global a
global b=100
global b
global a=100
Chapter: [0.01] Exceptional Handling in Python
An exception may be raised even if the program is syntactically correct.
True
False
Chapter: [0.01] Exceptional Handling in Python
Which of the following statements is FALSE about keys in a relational database?
Any candidate key is eligible to become a primary key.
A primary key uniquely identifies the tuples in a relation.
A candidate key that is not a primary key is a foreign key.
A foreign key is an attribute whose value is derived from the primary key of another relation.
Chapter: [0.08] Database Concepts
In case of ______ switching, before a communication starts, a dedicated path is identified between the sender and the receiver.
Chapter: [0.11] Data Communication
Which of the following functions changes the position of file pointer and returns its new position?
flush ()
tell ()
seek ()
offset ()
Chapter: [0.02] File Handling in Python
- Assertion(A): List is an immutable data type.
- Reasoning(R): When an attempt is made to update the value of an immutable variable, the old variable is destroyed and a new variable is created by the same name in memory.
Both A and R are true and R is the correct explanation for A.
Both A and R are true and R is not the correct explanation for A.
A is True but R is False.
A is false but R is True.
Chapter: [0.01] Exceptional Handling in Python
- Assertion(A): Python standard library consists of number of modules.
- Reasoning(R): A function in a module is used to simplify the code and avoids repetition.
Both A and R are true and R is the correct explanation for A.
Both A and R are true and R is not the correct explanation for A.
A is True but R is False.
A is false but R is True.
Chapter: [0.01] Exceptional Handling in Python
Expand the following in the context of Internet Protocol:
POP3
Chapter: [0.11] Data Communication
Expand the following:
URL
Chapter: [0.05] Python - Communication Technologies [0.1] Computer Networks
Advertisements
Write two points of difference between XML and HTML.
Chapter: [0.05] Python - Communication Technologies [0.1] Computer Networks
Define the term bandwidth with respect to networks.
Chapter: [0.11] Data Communication
How is http different from https?
Chapter: [0.12] Security Aspects
The code given below accepts a number as an argument and returns the reverse number. Observe the following code carefully and rewrite it after removing all syntax and logical errors. Underline all the corrections made.
define revNumber (num) :
rev = 0
rem = 0
While num > 0:
rem ==num %10
rev = rev*10 + rem
num = num//10
return rev
print (revNumber (1234))
Chapter: [0.01] Exceptional Handling in Python
Write a function countNow (PLACES) in Python, that takes the dictionary, PLACES as an argument and displays the names (in uppercase) of the places whose names are longer than 5 characters.
For example, Consider the following dictionary
PLACES={1:"Delhi",2:"London",3:"Paris",4:"New York",5:"Doha"}
The output should be:
- LONDON
- NEW YORK
Chapter: [0.01] Exceptional Handling in Python
Write a function, lenWords(STRING), that takes a string as an argument and returns a tuple containing length of each word of a string.
For example, if the string is "Come let us have some fun", the tuple will have (4, 3, 2, 4, 4, 3)
Chapter: [0.02] File Handling in Python
Predict the output of the following code:
S = "LOST"
L = [10, 21, 33, 4]
D={}
for I in range(len(S)):
if I%2==0:
D[L.pop()] = S[I]
else:
D[L.pop ()] = I+3
for K,V in D.items () :
print (K,V, sep="*")
Chapter:
Write the Python statement for the following task using the BUILT-IN function/method only:
To insert an element 200 at the third position, in the list L1.
Chapter: [0.01] Exceptional Handling in Python
Write the Python statement for the following task using the BUILT-IN function/method only:
To check whether a string named, message ends with a full stop/period or not.
Chapter: [0.01] Exceptional Handling in Python
A list named studentAge stores age of students of a class. Write the Python command to import the required module and (using built-in function) to display the most common age value from the given list.
Chapter: [0.01] Exceptional Handling in Python
Ms Shalini has just created a table named “Employee” containing columns Ename, Department and Salary. After creating the table, she realized that she has forgotten to add a primary key column in the table. Help her in writing an SQL command to add a primary key column EmpId of integer type to the table Employee.
Thereafter, write the command to insert the following record in the table:
EmpId- 999
Ename- Shweta
Department: Production
Salary: 26900
Chapter: [0.09] Structured Query language (SQL)
Zack is working in a database named SPORT, in which he has created a table named “Sports” containing columns SportId, SportName, no_of_players, and category.
After creating the table, he realized that the attribute, category has to be deleted from the table and a new attribute TypeSport of data type string has to be added. This attribute TypeSport cannot be left blank. Help Zack write the commands to complete both the tasks.
Chapter: [0.09] Structured Query language (SQL)
Predict the output of the following code:
def Changer (P, Q=10):
P=P/Q
Q=P%Q
return P
A=200
B=20
A=Changer(A,B)
print(A,B,sep='$')
B=Changer(B)
print(A,B sep='$', end='# # #')
Chapter: [0.01] Exceptional Handling in Python
Predict the output of the Python code given below:
Text1="IND-23"
Text2=""
I=0
While I<len (Text1):
if Text1[I]>="0" and Text1 [I]<="9":
Val = int (Text1 [I])
Val = Val + 1
Text2=Text2 + str(Val)
elif Text1 [I]>="A" and Text 1 [I]<="Z":
Text2=Text2 + (Text1 [I + 1])
else:
Text2=Text2 + "*"
I+=1
print (Text2)
Chapter: [0.01] Exceptional Handling in Python
Consider the table CLUB given below and write the output of the SQL queries that follow.
CID | CNAME | AGE | GENDER | SPORTS | PAY | DOAPP |
5246 | AMRITA | 35 | FEMALE | CHESS | 900 | 2006- 03-27 |
4687 | SHYAM | 37 | MALE | CRICKET | 1300 | 2004- 04-15 |
1245 | MEENA | 23 | FEMALE | VOLLEYBALL | 1000 | 2007- 06-18 |
1622 | AMRIT | 28 | MALE | KARATE | 1000 | 2007- 09-05 |
1256 | AMINA | 36 | FEMALE | CHESS | 1100 | 2003- 08-15 |
1720 | MANJU | 33 | FEMALE | KARATE | 1250 | 2004- 04-10 |
2321 | VIRAT | 35 | MALE | CRICKET | 1050 | 2005- 04-30 |
- SELECT COUNT(DISTINCT SPORTS) FROM CLUB;
- SELECT CNAME, SPORTS FROM CLUB
WHERE DOAPP<"2006-04-30" AND CNAME LIKE "%NA"; - SELECT CNAME, AGE, PAY FROM CLUB WHERE GENDER = "MALE" AND PAY BETWEEN 1000 AND 1200;
Chapter: [0.09] Structured Query language (SQL)
Advertisements
Write a function in Python to read a text file, Alpha.txt and displays those lines which begin with the word ‘You’.
Chapter: [0.02] File Handling in Python
Write a function, vowelCount() in Python that counts and displays the number of vowels in the text file named Poem.txt.
Chapter: [0.02] File Handling in Python
Consider the table Personal given below:
Table: Personal | ||||
P_ID | Name | Desig | Salary | Allowance |
P01 | Rohit | Manager | 89000 | 4800 |
P02 | Kashish | Clerk | NULL | 1600 |
P03 | Mahesh | Superviser | 48000 | NULL |
P04 | Salil | Clerk | 31000 | 1900 |
P05 | Ravina | Superviser | NULL | 2100 |
Based on the given table, write SQL queries for the following:
- Increase the salary by 5% of personals whose allowance is known.
- Display Name and Total Salary (sum of Salary and Allowance) of all personals. The column heading ‘Total Salary’ should also be displayed.
- Delete the record of Supervisors who have salary greater than 25000.
Chapter: [0.09] Structured Query language (SQL)
A list, NList contains following record as list elements:
[City, Country, distance from Delhi]
Each of these records are nested together to form a nested list. Write the following user defined functions in Python to perform the specified operations on the stack named travel.
- Push_element(NList): It takes the nested list as an argument and pushes a list object containing name of the city and country, which are not in India and distance is less than 3500 km from Delhi.
- Pop_element(): It pops the objects from the stack and displays them. Also, the function should display “Stack Empty” when there are no elements in the stack.
For example: If the nested list contains the following data:
NList=[["New York", "U.S.A.", 11734],
["Naypyidaw", "Myanmar", 3219],
["Dubai", "UAE", 2194],
["London", "England", 6693],
["Gangtok", "India", 1580],
["Columbo", "Sri Lanka", 3405]]
The stack should contain:
['Naypyidaw', 'Myanmar'],
['Dubai', 'UAE'],
['Columbo', 'Sri Lanka']
The output should be:
['Columbo', 'Sri Lanka']
['Dubai', 'UAE']
['Naypyidaw', 'Myanmar']
Stack Empty
Chapter:
Consider the tables PRODUCT and BRAND given below:
Table: PRODUCT | ||||
PCode | PName | UPrice | Rating | BID |
P01 | Shampoo | 120 | 6 | M03 |
P02 | Toothpaste | 54 | 8 | M02 |
P03 | Soap | 25 | 7 | M03 |
P04 | Toothpaste | 65 | 4 | M04 |
P05 | Soap | 38 | 5 | M05 |
P06 | Shampoo | 245 | 6 | M05 |
Table: BRAND | |
BID | BName |
M02 | Dant Kanti |
M03 | Medimix |
M04 | Pepsodent |
M05 | Dove |
Write SQL queries for the following:
- Display product name and brand name from the tables PRODUCT and BRAND.
- Display the structure of the table PRODUCT.
- Display the average rating of Medimix and Dove brands.
- Display the name, price, and rating of products in descending order of rating.
Chapter: [0.09] Structured Query language (SQL)
Vedansh is a Python programmer working in a school. For the Annual Sports Event, he has created a csv file named Result.csv, to store the results of students in different sports events. The structure of
Result.csv is:
[St_Id, St_Name, Game_Name, Result]
Where
St_Id is Student ID (integer)
ST_name is Student Name (string)
Game_Name is name of game in which student is participating(string). Result is result of the game whose value can be either 'Won', 'Lost' or 'Tie'.
For efficiently maintaining data of the event, Vedansh wants to write the following user defined functions:
Accept() - to accept a record from the user and add it to the file
Result.csv. The column headings should also be added on top of the csv file.
wonCount() - to count the number of students who have won any event.
As a Python expert, help him complete the task.
Chapter: [0.02] File Handling in Python
Meticulous EduServe is an educational organization. It is planning to setup its India campus at Chennai with its head office at Delhi. The Chennai campus has 4 main buildings - ADMIN, ENGINEERING, BUSINESS and MEDIA.
Block to Block distances (in Mtrs.)
From | To | Distance |
ADMIN | ENGINEERING | 55 m |
ADMIN | BUSINESS | 90 m |
ADMIN | MEDIA | 50 m |
ENGINEERING | BUSINESS | 55 m |
ENGINEERING | MEDIA | 50 m |
BUSINESS | MEDIA | 45 m |
DELHI HEAD OFFICE | CHENNAI CAMPUS | 2175 km |
Number of computers in each of the blocks/Center is as follows:
ADMIN | 110 |
ENGINEERING | 75 |
BUSINESS | 40 |
MEDIA | 12 |
DELHI HEAD | 20 |
- Suggest and draw the cable layout to efficiently connect various blocks of buildings within the CHENNAI campus for connecting the digital devices.
- Which network device will be used to connect computers in each block to form a local area network?
- Which block, in Chennai Campus should be made the server? Justify your answer.
- Which fast and very effective wireless transmission medium should preferably be used to connect the head office at DELHI with the campus in CHENNAI?
- Suggest a device/software to be installed in the CHENNAI Campus to take care of data security.
Chapter: [0.05] Python - Communication Technologies [0.1] Computer Networks
Differentiate between r+ and w+ file modes in Python.
Chapter: [0.02] File Handling in Python
Consider a file, SPORT.DAT, containing records of the following structure:
[SportName, TeamName, No_Players]
Write a function, copyData(), that reads contents from the file SPORT.DAT and copies the records with Sport name as “Basket Ball” to the file named BASKET.DAT. The function should return the total number of records copied to the file BASKET.DAT.
Chapter: [0.02] File Handling in Python
How are text files different from binary files?
Chapter: [0.02] Advance Programming with Python [0.02] File Handling in Python
A Binary file, CINEMA.DAT has the following structure:
{MNO:[MNAME, MTYPE]}
Where
- MNO - Movie Number
- MNAME - Movie Name
- MTYPE is Movie Type
Write a user defined function, findType(mtype), that accepts mtype as parameter and displays all the records from the binary file CINEMA.DAT, that have the value of Movie Type as mtype.
Chapter: [0.02] File Handling in Python
Define the term Domain with respect to RDBMS. Give one example to support your answer.
Chapter: [0.08] Database Concepts
Kabir wants to write a program in Python to insert the following record in the table named Student in MYSQL database,
SCHOOL:
- rno(Roll number) - integer
- name(Name) - string
- DOB (Date of birth) - Date
- Fee - float
Note the following to establish connectivity between Python and MySQL:
- Username - root
- Password - tiger
- Host - localhost
The values of fields rno, name, DOB and fee has to be accepted from the user. Help Kabir to write the program in Python.
Chapter: [0.09] Structured Query language (SQL)
Give one difference between alternate key and candidate key.
Chapter: [0.08] Database Concepts
Sartaj has created a table named Student in MYSQL database, SCHOOL:
- rno(Roll number )- integer
- name(Name) - string
- DOB (Date of birth) – Date
- Fee – float
Note the following to establish connectivity between Python and MySQL:
- Username - root
- Password - tiger
- Host - localhost
Sartaj, now wants to display the records of students whose fee is more than 5000. Help Sartaj to write the program in Python.
Chapter: [0.09] Structured Query language (SQL)
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 2023 - 2024
Previous year Question paper for CBSE Class 12 Computer Science (Python)-2024 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.