Professional Documents
Culture Documents
XII CS Preboard - 2 QP Updated
XII CS Preboard - 2 QP Updated
2 Given the list L=[“A”, “E”, “I”, “O”, “U”] , write the output of print(L[2:5]) 1
a)[“A”, “O”, “U”] b) [“U”, “O”, “U”] c) [“E”, “O”, “U”] d) [“I”, “O”, “U”]
a) and b) or c) by d) not
5. Suppose a tuple K is declared as K = (100, 102, 143, 309), which of the following 1
is incorrect?
a)print(K[-1])
b) K[3] =405
c) print(min(K))
d) print(max(K))
6. Write a statement in Python to declare a dictionary whose keys areSub1, Sub2, 1
Sub3 and values are Physics, Chemistry, Math respectively.
a) {“Sub1” : “Physics” , “Sub2” : “Chemistry” , “Sub3”: “Math”}
b) [“Sub1” : “Physics” , “Sub2” : “Chemistry” , “Sub3”: “Math”]
c) (“Sub1” : “Physics” , “Sub2” : “Chemistry” , “Sub3”: “Math”)
d) #“Sub1” : “Physics” , “Sub2” : “Chemistry” , “Sub3”: “Math”#
7. A List is declared as 1
List1=[2,3,5,7,9,11,13]
a) 6 b) 7 c) 9 d)10
10 Ms. Priya is an IT expert. She recently used her skills to access the Admin password 1
for the network server of Happiest Minds Technology Ltd. and provided confidential
data of the organization to its CEO, informing him about the vulnerability of their
network security. Out of the following options which one most appropriately defines
Ms. Priya?
11. In SQL, name the clause that is used to sort the records in 1
ascending/descending order of an attribute.
13. Name the aggregate function to find the average value in SQL. 1
15. Name the transmission media best suitable for difficult terrain like hilly 1
areas.
17. Assertion (A):- If the arguments in function call statement match the number and order 1
of arguments as defined in the function definition, such arguments are called positional
arguments.
Reasoning (R):- During a function call, the argument list first contains default
argument(s) followed by positional argument(s).
Mark the correct choice as
(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
18. Assertion (A):- The result set refers to a logical set of records that are fetched 1
from the database by executing an SQL query.
Reasoning (R):-
Result set stored in a cursor object can be extracted by using fetch(…) functions.
(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
22. Differentiate between positional parameters and default parameters with suitable 2
example program for each.
OR
How can a function return multiple values? Illustrate with an
example program.
23. Rewrite the following code in Python after removing all syntax error(s). Underline 2
each correction done in the code.
24. What are the incorrect output(s) from the given options when the following code is 2
executed? Also specify the minimum and maximum values that can be assigned to the
variable VALUE.
import random
VALUE = random.randint (0,3)
SUBJECT=[“PHY”,”CHEM”,”MATHS”,”COMP”];
for I in SUBJECT:
for J in range(1, VALUE):
print(I, end=””)
print()
Options:
i) PHYPHY ii) PHY
CHEMCHEM PHYCHEM
MATHSMAT PHYCHEMMAT
HS HS
COMPCOMP
iii) PHY iv) PHY
CHEMCHEM CHEM
COMPCOMPCOMP MATHS
COMP
Section- C
26. Write a function Interchange (num) in Python, which accepts a list num of integers, and 3
interchange the adjacent elements of the list and print the modified list as shown below:
(Number of elements in the list is assumed aseven)
Original List:
num = [5,7,9,11,13,15]
After Rearrangement num = [7,5,11,9,15,13]
27. Write a function in Python that displays the words, starting with uppercaseletter in a 3
file ‘legend.txt’.
28. Write the outputs of the SQL queries (i) to (iii) based on the relations Car and 3
Customer given below:
Car
Ccode Cname Make Colour Capacity Charges
201 Triber Renault Yellow 7 1000
203 Altroz Tata Black 5 1500
29. Write a function in Python Push (nums), where nums is a list of numbers. From this list 3
push all odd numbers into a stack implemented by using a list.Display the stack if it has
at least one element, otherwise display appropriate error message.
OR
30. Find and write the output of the following Python code: 3
str2=""
for i in range(0,len(str1)-1):
if(str1[i].islower()):
str2=str2+str1[i].upper()elif
str1[i].isupper():
str2=str2+str1[i].lower()elif
str1[i].isdigit():
str2=str2+'d' else:
str2=str2+(str1[1-i])
print(str2)
Shuffle('Pre-Board Exam@2023')
Section -D
31. Young Minds Ltd. is an educational organization. It is planning to setup its India 5
campus at Chennai with its head office at Delhi. The Chennai campus has 4
main buildings – ADMIN, ENGINEERING, BUSINESS and MEDIA. You
as a network expert have to suggest the best network related solutions for
their problems raised in (i) to (v), keeping in mind the distances between the
buildings and other given parameters.
(i) Suggest the most appropriate location of the server inside the CHENNAI campus
(out of the 4 buildings), to get the best connectivity for maximum no. of computers.
Justify your answer.
(ii) Suggest the topology and draw the cable layout to efficiently connect various
buildings within the CHENNAI campus.
(iii) Which hardware device will you suggest to be procured by the company to minimize
the transmission loss?
(iv) Which will be the most suitable wireless communication medium to connect
Chennai campus with its Delhi head office?
32. Write the SQL commands for the following questions (i) to (v) based on therelations 5
Car and Customer given below:
Car
Ccode Cname Make Colour Capacity Charges
201 Triber Renault Yellow 7 1000
203 Altroz Tata Black 5 1500
208 Innova Toyota Silver 8 3000
209 Harrier Tata White 6 2000
212 Duster Renault Red 6 2500
217 Ertiga Suzuki Grey 7 2300
Customer
(i) To display the Names and Charges of all the Silver coloured cars.
(ii) To display the non duplicate car codes in the customer table.
(iii) To display the Minimum and Maximum car charges.
(iv) To give a discount of 10% in the car charges for existing customers (whoare in the
customer table).
(v) To display Name and Make of cars whose charges is in the range 2000
to 3000 (both inclusive).
33. A binary file “vehicle.dat” has structure [RegNo, Type, Make, Year]. 5
a. Write a user defined function AddVahan() to input data for a vehicleand add to
“vehicle.dat” file.
b. Write a function CountVahan(Type) in Python which accepts the Type of the
vehicle as the parameter and count and return the number of vehicles of the given
Type.
OR
A binary file “player.dat” has structure (PlayerId, Name, Team, StrikeRate). Write a
function ShowPlayer() in Python that would read contents of the fileand display the
details of those players whose Team is “India” and StrikeRate is above 50. Also display
the total number of such players.
Section E
34 A Book store Current Books is planning to store their book details in a database using 4
SQL. As a database administrator, Poorvekka has decidedthat:
(a) Name of the database – CB
(b) Name of the table - Collections
(c) The attributes of Collections are as follows:
BookNo - Numeric
BookName – Character of size 25Price –
Numeric
Quantity – Numeric
Table : Collections
BookNo BookName Price Quantity
1647 The Lowland 399 75
5241 The Inheritance Of Loss 555 44
3546 The Guide 641 60
4541 Untouchable 529 53
5025 Train to Pakistan 643 73
6783 Godan 341 97
7614 The God Of Small Things 555 48
(b) Identify the attribute best suitable to be declared as a primary key,
(c) Write the degree and cardinality of the table Collections.
(d) Write SQL command to increment the quantity by 20 whereverquantity is
below 50.
( e) Poorvekka wants to remove the entire data from table Collections.
(f) Which command will she use from the following:
a. DELETE FROM Collections;
b. DELETE Collections;
c. DROP DATABASE CB;
d. DELETE * FROM Collections;
35 Atul Prakash of Class 12 is writing a program to create a CSV file “students.csv” which 4
will contain student name and admission number for some entries. He has written the
following code. As a programmer, help him to successfully execute the given task.
import # Line 1
AddStudents(“Raghava”, “2541”)
AddStudents (“Pooja”,”3411”)
AddStudents(“Krutika”,”2218”)
Retrievestudents () #Line 5