qp_csxii_pb1_set2
qp_csxii_pb1_set2
आगरा संभाग
General Instructions:
● This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided 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 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written.
Q.no./ Part-A Marks
प्रश्न भाग- अ अंक
संख्या
1 State True or False: 1
None is same as 0 or Empty String
Page 3 of 12
value = value - n
print(value,end='#')
show(20)
print(value,end='%')
(A) 12%15#
(B) 10#5%
(C) 12#15%
(D) 12%15#
13 Which SQL command can change the data type of already present 1
attribute of an existing relation?
14 What will be the output of the query? 1
SELECT AVG(SALARY) FROM EMPLOYEE WHERE CITY LIKE ‘%R’;
(A) Average of salary for cities whose names start with 'R'
(B) Average of salary for cities whose names end with 'R'
(C) Salary for cities whose names end with 'R'
(D) Salary for cities whose names starts with ‘R’
15 To store the grade of students, which of the following data type will be 1
used?
(a) Char (b)Int (c )Date (d) float
16 The following command 1
Select count(*) from employee;
Will show (a) degree (b) cardinality (c) domain
17 Suggest a protocol that is used to transmit E-mail over internet.
(A) HTTP (B) FTP (C) VoIP (D)SMTP
18 Which network device is used to connect two networks that use same 1
protocols?
(A) Modem (B) Gateway (C)Switch (D)Bridge
19 Which switching technique follows the store and forward mechanism? 1
(a) Circuit switching (b) message switching
(c) packet switching (d) All of these
Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the
correct choice as:
Page 4 of 12
(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
20 Assertion (A): A variable declared as global inside a function is visible 1
with changes made to it outside the function.
Reasoning (R): All variables declared outside are not visible inside a
function till they are redeclared with global keyword
21 Assertion (A): Aggregate functions operate on groups of rows and return 1
a single result for each group.
Reasoning (R): It can be used with WHERE and HAVING clauses only.
Ques. PART B Marks
No.
22 How is a mutable object different from an immutable object in Python? 2
Identify one mutable object and one immutable object from the following:
{21:12,12:21}, (21,12), [12,21], ‘1231’
23 Give two examples of each of the following: 2
(I) Logical operators (II) Relational operator
24 Given is a Python List declaration: 2
lst1= [39, 45, 23, 15, 25, 60]
(Answer using built in functions only)
(a) Insert value 90 at index 3
(b) Display elements of list in reverse
OR
(a) Add another list [2,3,4] at end of lst1
(b) Find sum of elements of list
25 What possible output(s) are expected to be displayed on screen at the 2
time of execution of the program from the following code? Find
maximum and minimum value of begin.
import random
points=[30,50,20,40,45]
begin=random.randint(1,3)
Page 5 of 12
last=random.randint(2,4)
for c in range(begin,last+1):
print(points[c],"#")
(a) 20#50#30# (b) 20#40#45
(c) 50#20#40# (d) both (b) and (c)
26 There are syntax and logical errors in the code. Rewrite it after removing 2
all errors. Underline all the corrections made.
def find_sum(tup1,tup2)
newtup=tup1+tup2
return newtup
Page 6 of 12
29 Write a function capit() in Python to read content of a text file 3
‘NOTES.TXT’ and display the entire content in capital letters.
OR
Write a function Disp_Lines() in Python which should read lines from a
text file MYFILE.TXT and display the lines starting with the alphabet T.
30 A) You have a stack named ItemsStack that contains records of 3
Items.
Each Item record is represented as a list containing Item_title,
name, and price. Write the following user-defined functions in
Python to perform the specified operations on the stack
ItemsStack:
(I) push_Item(ItemsStack, new_Item): This function takes the
stack ItemsStack and a new Item record new_Item as
arguments and pushes the new Item record onto the stack.
(II) pop_Item(ItemsStack): This function pops the topmost Item
record from the stack and returns it. If the stack is already
empty, the function should display "Underflow".
(III) (III) peep(ItemsStack): This function displays the topmost
element of the stack without deleting it. If the stack is empty,
the function should display 'None'.
OR
(B) Write the definition of a user-defined function `push_div(N)` which
accepts a list of integers in a parameter `N` and pushes all those integers
which divisible by 5 from the list `N` into a Stack named `Numbers`.
Write function pop_div() to pop the topmost number from the stack and
returns it. If the stack is already empty, the function should display
"Empty".
Write function Disp_div() to display all element of the stack without
deleting them. If the stack is empty, the function should display 'None'
For example: If the integers input into the list VALUES are: [15, 25, 28,
23, 20] Then the stack `Numbers` should store: [15, 25, 20]
31 Predict the output of the following code : 3
Page 7 of 12
d={"IND":"DEL","SRI” :"COL","CHI":"BEI"}
str1=""
for i in d:
str1=str1+str(d[i])+"@"
str2=str1[:–1]
print (str2)
OR
L=[1,2,3,4,5]
Lst=[]
for i in range(len(L)):
if i%2==1:
t=(L[i],L[i]**2)
Lst.append(t)
print(Lst)
Ques. PART D Marks
No.
32 Consider the table CHIPS as given below: 4
TABLE: CHIPS
LAYS ONION 10 5
BIKANO TOMATO 20 12
UNCLE CHIPS SPICY 12 10
KALEVA PUDINA 10 12
HALDIRAM SALTY 10 20
HALDIRAM TOMATO 25 30
Page 8 of 12
d) To display names of those brands whose name have anywhere ‘K’
in their Brand_name .
OR
Page 9 of 12
2 Mathematics Jaipur
3 Computer Sc Nagpur
Page 10 of 12
36 Write a Program in Python that defines and calls the following user 5
defined functions:
• ADD() – To accept and append data of an item to a binary file
‘furniture.dat’. Each record of the file is a list [Fur_id, Description,
Price, and Discount]. Fur_Id and Description are of str type, Price
is of int type, and Discount is of float type.
• UPDATE() – To change discount as 5000 for furniture item whose
Description is ‘Computer Table’.
• COUNTR() – To count the number of records present in
‘furniture.dat’ whose price is less than 5000.
37 Total-IT Corporation, a Karnataka based IT training company, is planning 5
Page 11 of 12
Kodagu Campus to Coimbatore Campus 304 km
Number of computers:
Block Number of Computers
IT 75
DS 50
IoT 80
Page 12 of 12