XIInfo Pract H Y 402
XIInfo Pract H Y 402
XIInfo Pract H Y 402
General Instructions:
1. This question paper contains two parts A and B. Each part is compulsory.
2. Part-A has 2 sections:
a. Section – I has 21 multiple choice questions.
b. Section – II has 14 questions, to be answered in one word or one line.
3. Part - B is Descriptive Paper.
4. Part- B has three sections
a. Section-I is short answer questions of 2 marks each in which two questions have internal options.
b. Section-II is long answer questions of 3 marks each in which two questions have internal options.
c. Section-III is very long answer questions of 5 marks each in which two questions have internal options.
5. All programming questions are to be answered using Python Language only.
PART – A
SECTION – I
Select the most appropriate option out of the options given for each question. [21 x 1 = 21]
1
(a) and (b) as (c) while (d) until
9. To give a different separator with print( ) ____________ argument is used.
(a) Sep (b) sep (c) end (d) separator
10.Which of the following is not an immutable type in Python?
(a) string (b) tuples (c) float (d) dictionary
11.What value does the following expression evaluate to?
2 + 9 * ((3 * 12) – 8) / 10
(a) 27 (b) 27.2 (c) 30.8 (d) None of these
12.What will be the output of the expression?
10 or 0
(a) 0 (b) 1 (c) 10 (d) True
13.Choose correct option :
S1=’python’
S1[0]=S1[0].upper()
Statement 1: Above code will generate error.
Statement 2: String is mutable by nature.
(a) Only Statement 1 is true.
(b) Only Statement 2 is true.
(c) Both Statement 1 and 2 are true, but Statement 2 is not the correct reasoning of
Statement 1.
(d) Both Statement 1 and 2 are true, but Statement 2 is the correct reasoning of Statement 1.
14.Choose correct option :
X=2**3**2
Statement 1: Order of execution of Multiple Power operators in an expression is Left to
Right.
Statement 2: Value of X will be 512.
(a) Only Statement 1 is true.
(b) Only Statement 2 is true.
(c) Both Statement 1 and 2 are true, but Statement 2 is not correct reasoning of
Statement 1.
(d) Both Statement 1 and 2 are true, but Statement 2 is correct reasoning of Statement 1.
15. (A) Assertion
L=[12,20,34,56,78] and L2 = 23 then
print(L1.extend(L2)) will give an error.
(R) Reason : L2 is an integer type of identifier so extend() function won‟t work.
(a) A is true but R is false
(b) A is true and R is correct explanation of A
(c) A and B both are false
(d) A is false and R is correct
2
16. What will be the output of the given program segment?
for I in range(10, 1, 1):
print(I)
print(I)
(a) 10 (b) 9 (c) Error (d) None of the above
17. If L1=[1,3,5] and L2=[2,4,6] then L1+L2 will yield..
(a) [1,2,3,4,5,6] (b) [1,3,5,2,4,6] (c) [3,7,11] (d) [1,3,5,[2,4,6]]
18.Given a list L=[10,20,30,40,50,60,70] what would L[-3:99] return ?
(a) [20,30,40] (b) [30,40,50] (c) [40,50,60] (d) [50,60,70]
19. What gets printed ?
Names=[„Hasan‟ , „Ali‟, „Balwant‟ , „Sean‟ , „Din‟]
print(Names[-1][-3] )
(a) H (b) D (c) Has (d) Din
20.Which of the following can delete an element from a list?
(a) pop( ) (b) remove( ) (c) del (d) All of these
21.To increase the value of X five times using an augmented assignment operator, the correct
expression will be
(a) X+=5 (b) X*=5 (c) X=X**5 (d) None of these
SECTION-II
Each question carries 1 mark.
str1[2]= „P‟
30. What is the use of range() function? What would range(3,13) return?
31. What is the difference between if……else and if ….. elif ….. else statement?
3
32. What is the difference between following expressions,
print(a == b)
print(a is b)
34. Name the function which is used to insert value at the end of the list.
PART – B
SECTION – I
Each question carries 2 marks.
36. What is the function of CPU in a computer system? What are its sub units? Explain.
37. What is the difference between an expression and a statement in Python?
38. What is the output of the following code? How many times is the condition of if clause
evaluated?
for i in range (4):
for j in range(5) :
if i+1 == j or j+i == 4 :
print(“+”,end=‟ „ )
SECTION – II
Each question carries 3 marks.
41. Differentiate between proprietary software and freeware software. Name of two softwares
of each type.
4
(B) The list [ „a‟ , „aa‟, „aaa‟ , „aaaa‟ , ……… ] that ends with 26 copies of the letter a.
(c) c=0
for x in range (10) :
for y in range (5) :
c+=1
print(c)
44. Differentiate between pop( ) and remove( ) functions of list. Write examples for both.
45. Write following expressions in Python.
(1) 1/3 b2h (2) (3) (x-h)2 + (y-k)2 = r2
SECTION – III
Each question carries 5 marks. Attempt any 2 questions from this section.
46. Carefully go through the code given below and answer the questions based on it
1. Choose the correct option from the following to fill the blank in line 1.
A. extend( ) B. append( ) C. add( ) D. insert( )
2. Which of the following functions is used to delete an element from the list in line 2?
A. pop ( ) B. del C. remove( ) D. del( )
47. Write a menu driven program in Python which reads a name and total marks of student
from user and compute percentage and print name and grade for the student.
Above 90 A
70-90 B
55-70 C
33-55 D
Less than 33 Fail
48. Describe the following functions of list data type with example.
(A) extend( ) (B) remove ( ) (C) sorted( ) (D) append( ) (E) min( )