0% found this document useful (0 votes)
21 views228 pages

Chapter 1

Uploaded by

FK ŤHŘÔŇÉŠ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views228 pages

Chapter 1

Uploaded by

FK ŤHŘÔŇÉŠ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 228

Name of the Chapter - Python Revision Tour

Question Question Content Learning


No Objective (if
Provided)
1. Full Form of IDLE Knowledge
A. INDUSTRIAL DEVELOPMENT
LEARNING ENVIRONMENT
B. INTEGRATE DRIVE LEARNING ENVIRONMENT
C. INTEGRATED DEVELOPMENT LEARNING
ENVIRONMENT
D. INTEGRATED DEVELOPMENT LEARNING
ENGINEERING
c
2. Python is..........................language Knowledge
A. High level language
B. Low level language
C. Medium level language
D. Machine language
A

3. Which statement is correct Understanding


A. Python is Upper case sensitive
B. Python is Case-Sensitive
C. Python is Lower case sensitive
D. Python is Case-Insensitive
B

4. Which statement is correct Knowledge


A. It is free language
B. It is open source language
C. It is free and open source language
D. None of the above\
C

5. Tick the correct statement to print hello. Application


A. print(hello)
B. print(“hello”)
C. Print(“hello”)
D. Print(hello)
B

6. Python programs are executed by which language processor? Knowledge


A. Compiler
B. Interpreter
C. Assembler
D. All of the above
B

7. Which of the statement is correct? Understanding


A. Python is not portable and platform independent.
B. Python is portable and platform dependent.
C. Python is portable and platform independent.
D. Python is not portable and platform dependent.
C

8. Which of the following is not high level programming language? Analysis


A. JAVA
B. Visual basic
C. Python
D. Machine language
D
9. Which of the following is not compiler based programming Analysis
language.
A. Python
B. C
C. C++
D. JAVA
E. A

10. Find the output of the following program Evaluation


A=0
print(a)
A. A
B. a
C. 0
D. Error
E. D

11. What is a program?


A. A set of rules.
B. A set of ordered instructions.
C. A set consist of 0 and 1.
D. A set of unordered instructions.
E. B

12. Computer understands a low level language. A low level Analysis


language consist of a set of digits
A. (1,2,3,4)
B. (0,1,2,3,4,5,6,7,8,9)
C. (0,1)

D. (0,1,2,3,4,5,6,7)
E. C
13. Which function can be used to display the output in python Analysis
A. show()
B. print()
C. display()
D. output()
B

14. Tick the correct statement to print Hello World. Evaluation


A. print(hello)(world)
B. Print(“hello world”)
C. Print(hello world)
D. print(“Hello World ”)
D

15. . Find the output of the following program Evaluation


A=0
print(A)
A. A
B. a
C. 0
D. 1
C
16 Question: Python uses to convert its instructions Understanding,
into machine language.
(A)Interpreter
(B)Compiler
(C)Both of the above
(D)None of the above
A
17 Question:Which of the following is not the feature of python Understanding,
language?
(A) Python is proprietary software.
(B)Python is not case-sensitive.
(C)Python uses brackets for blocks and nested blocks.
(D)All of the above
D
18
Question:By default, the Python scripts are saved with Understanding,
extension.
(A) .pyp
(B).pys
(C).py
(D)None of the above
19
C
Question:Which of the following is String literal? Understanding
(A) “ABC”
(B)“123”
(C)Both of the above
20 (D)None of the above
C
Question:print(“I” + “am” + “in” + “school”) display Application
(A) I am in school
(B)I Am In School
(C)Iaminschool
21
(D)iaminschool
A
Question:print(“I” , “am” , “in” , “school”) display Application
(A) I am in school
(B)I Am In School
22 (C)Iaminschool
(D)iaminschool
Question:Which of the following is parameter of print( ) Evaluation
function?
(A) sep
(D) None of the above
(E) C
23 Question:The process of removing errors from programs Understanding,
is called
(A) Programming
(B)Documentation
(C)Debugging
(D)None of the above
B
24
Question:IDLE stands for Knowledge,
(A) Integrated Development LEarning
(B)Integrated Development Learning Environment
(C)Intelligent Development Learning Environment
(D)None of the above
25 B
Question:Which of the following statement is correct Application
syntactically?
(A) print(“Hello” , sep == ‘@’ , end = ‘ ‘)
(B)print(“Hello” , sep = ‘@’ , end = ‘ ‘)
(C)Print(“Hello” , sep = ‘@’ , end = ‘ ‘)
(D)print(“Hello” , sep = ‘@’ , end = ‘ ‘
26
C
Question:Who developed the Python language? Knowledge,
(A) Zim Den
(B)Wick van Rossum
(C)Guido Van Rossum
27 (D)NieneStom
A
Question:In which year was the Python language developed? Knowledge,
(A) 1990
(B)1989

28 (C)1971
(D)1975
(B) C
(B) \t
(C) \n
(D) \b

29 Knowledge,
Question:Which of the following functions print the output to
the console?
(A) Output( )
(B)Print( )
(C)Echo( )
(D)print( )
D
30
Understanding
Question:The default separator character of print( ) is ……….
(A) tab
(B)space
(C)newline
(D)dot
31 A
Knowledge
Which of the following is correct about python?

a. Python is an open source language.

b. Python is not based on ABC language.

c. Python is not a case sensitive

d. All of the above


e. A
32 Which two languages contributed to Python as a Knowledge
Programming Language?

1. C++ and ABC language


2. BASIC and Modula 3
3. ABC language and Modula 3
4. None of the Above
5. C
33 When was Python released? Knowledge

a. Python was released in September 1991.

b. Python was released in February 1991.

c. Python was released in February 1990.

d. Python was released in March 1991


e. B

34 Python code can run on a variety of platforms, it Understanding


means Python is alanguage.

1. Graphical
2. Cross-platform
3. Independent
4. All of these
5. B
35 Python uses a/an............to convert source code to object code. Understanding

1. Interpreter
2. Compiler
3. Combination of Interpreter and compiler
4. Special virtual engine
5. A
36 The interpreter is also called …………………… Application

a. Python Editor

b. Python Kernel

c. Python shell.

d. None of the Above


e. C

37 In the Python prompt, which symbol indicates that the Application


interpreter is ready to take instructions.

a. >>

b. >>>

c. <<>

d. >>>>
e. B
38 What is the output after executing the following code: Evaluation

Print(“Hello World!”)

a. >>>Hello World!

b. Hello World

c. Hello World!

d. Error
e. D

39 What is the result after executing the following: Evaluation

>>>print(20/4 *5+8-10)

a. 1

b. 23

c. 23.0

d. 24
e. C

40 What will be the output of the following code ? Evaluation

print(“150+300”)

(i) 450
(ii) 150300
(iii) 150+300

(iv) 300

(v) C
41 What do we use to define a block of code in Python language? Analysis

1. Key
2. Brackets
3. Indentation
4. None of these
5. C
42 Python interpreter executes.......................................statement Analysis
(Command) at a time.

1. Two
2. Three
3. One
4. All command
5. C
43 Which one is not the feature of Python- Understanding

1. Cross-platform
2. Interpreted
3. Free and Open source
4. Not a case-sensitive
5. D

44 A program written in a high-level language is called Understanding


………………

1. Compile code
2. Object code
3. Source code
4. Binary Code
5. C
45 IDLE stands for Analysis

a. Integrated Development or Learning Environment

b. Integrated Development and Learning


Environment

c. Integrate Development and Learning Environment

d. Integrated Development and Learned Environment


e. A

46 What is the maximum possible length of an identifier in


python?

(A) 16
Knowledge
(B) 32

(C) 64

(D) None of these


(E) D

47 Which of the following is not a keyword in python?

(A) eval

(B) assert Knowledge

(C) nonlocal

(D) Pass
(E) A
48 All keywords in python except TRUE and FALSE are in
?

(A) Lower case


Knowledge
(B) Upper case

(C) Capitalized

(D) None of the above


(E) A

49 Which of the following can not be a variable name?

(A) _init_ Knowledge

(B) in

(C) it

(D) On
(E) B

50 Which of the following operators is the correct option for


power(a,b)?

(A) Knowledge,

(B) a **b
Understand

(C)

(D)
B
51 Who developed the Python language?

(A) Zim Den

Knowledge
(B) Guido van Rossum

(C) Niene Stom

(D) Wick van Rossum

52 In which year was the python language developed?

(A) 1995

(B) 1972 Knowledge

(C) 1989

(D) 1981

53 Which one of the following is the correct extension of the


python file?

(A) .py
Knowledge
(B) .p

(C) .python

(D) .pyt
54 Which of the characters is used in python to make a single
line comment?
Knowledge
(A) /

(B) //

(C) #

(D) !

55 Which of the following is not a core data type in python?

(A) List

(B) Dictionary Knowledge

(C) Tuple

(D) Class

56 What data type is the object listed below?

L=[1,3,”Hello”,5]

(A) List Analysis

(B) Tuple

(C) Class

(D) Dictionary
57 Which one of these is the floor division operator?

(A) /

(B) // Knowledge

(C) %

(D) *

58 Which of the following has the highest precedence in


python?

(A) Exponential
Knowledge
(B) Additin

(C) Parenthesis

(D) Division

59 What will be the output of the following statement?

>>>a+bc

(A) a Analysis

(B) b

(C) ab

(D) abc
60 What is math.factorial(4.0)?

(A) 20

(B) 24 Evaluation

(C) 16

(D) 64

61
Which of the following belongs to integer datatype Knowledge

A) -12

B) 4.0

C) 3+4J

D) -2.05

62
Which of the following belongs to float datatype Knowledge

A) -12

B) -14.0

C) 3+4J

D) 4
63
Which of the following belongs to complex datatype Knowledge

A) -12

B) 4.0

C) 3+4J

D) -2.05

64
An ordered collection of items, where each item is indexed by Application
an integer is called:

A) MAPPING

B) SEQUENCES

C) SETS

D) NUMBERS

65
is a sequence of items separated by commas and the Application
items are enclosed in square brackets [ ]

A) LIST

B) DICTIONARY

C) STRING

D) TUPLE
66
is a sequence of items separated by commas and the Application
items are enclosed in paranthesis ()

A) LIST

B) DICTIONARY

C) STRING

D) TUPLE

67
holds data items in key-value pairs. Application

A) LIST

B) DICTIONARY

C) STRING

D) TUPLE

68
is a sequence of items separated by commas and the Application
items are enclosed in paranthesis ()

A) LIST

B) DICTIONARY

C) STRING

D) TUPLE
69
is an unordered collection of items separated by Application
commas and the items are enclosed in curly brackets { }

A) LIST

B) SETS

C) STRING

D) TUPLE

70
None is a special data type with a single value. It is used to knowlegde
signify the absence of value in a situation

A) TRUE

B) FALSE

C) NONE

D) NULL

71
Datatype conversion can happen : Understanding

A) ONLY EXPLICITY

B) ONLY IMPLICITY

C) BOTH EXPLICITLY AND IMPLICITLY

D) NONE OF THE ABOVE


72
Which of the following is mutable datatype: Analysis

A) INTEGER

B) FLOAT

C) STRING

D) LIST

73
Which of the following is immutable Analysis

A) LIST

B) DICTIONARY

C) STRING

D) NONE OF THE ABOVE

74
A list can contain the following: Application

A) ONLY NUMBERS

B) ONLY STRINGS

C) BOTH NUMBERS AND STRING

D) ONLY INTEGERS
75
String is a group of characters. These characters may be Application

A) ALPHABETS,

B) DIGITS

C) SPECIAL CHARACTERS INCLUDING SPACES.

D) ALL OF THE ABOVE

76 Numbers = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in Application


python?

A. List

B. Tuple

C. Set

D. None of these

77 If x=3.123, then int(x) will give ? Evaluation

A. 3.1

B. 0

C. 1

D. 3
78 Which of the following is not a data type in python? Knowledge

A. List

B. Tuple

C. Dictionary

D. Book

79 Which one of the following is False regarding data types in Application


Python?

A. In python, explicit data type conversion is


possible

B. Mutable data types are those that can


be changed.

C. Immutable data types are those that cannot


be changed.

D. None of the above


80 Which of the following function is used to know the data Understanding
type of a variable in Python?

A. datatype()

B. typeof()

C. type()

D. vartype()

81 If we change one datatype to another, then it called Knowledge

A. Type Casting

B. Type Conversion

C. Both of the above

D. None of the above


82 Consider the following sequence of statements : Application

A=100

B=A

Following the execution of above statements, python has


created how many objects and how many references?

A. One object Two reference

B. One object One reference

C. Two object Two reference

D. Two object One reference

83 What data type is the object below? Knowledge

L = {1:”One”,2:”Two”}

A. list

B. dictionary

C. array

D. tuple
84 Find Example of sequence datatype. Application

A. List

B. Tuple

C. Both of them

D. None of them

85 Which of these about a dictionary is false? Knowledge

A. The values of a dictionary can be accessed using


keys

B. The keys of a dictionary can be accessed using


values

C. Dictionaries aren’t ordered

D. Dictionaries are mutable

86 Can tuple be used as dictionary key in python? Understanding

A. True

B. False

C. Tuple is not used in python

D. None of the above


87 Which statement is correct? Understanding

A. List is immutable && Tuple is mutable

B. List is mutable && Tuple is immutable

C. Both are Mutable.

D. Both are Immutable

88 Which of the following option is a core data type in the Knowledge


python language?

A. Dictionary

B. List

C. String

D. d. All of the above

89 In order to store values in terms of key and value we use Knowledge


that core data type in python?

A. List

B. Class

C. Dictionary

D. Tuple
90 In which data type, indexing is not valid? Knowledge

A. List

B. String

C. Dictionary

D. None of the above

91 Which of the following operator can be classified as Knowledge


unary operator?

a. +
b. or
c. not
d. and

92 Which of the following operator has lowest Knowledge


precedence?

a. ()
b. .or
c. .not
d. .and
93 What is the output of the following code? Evaluation

a,b=8/4/2, 8/(4/2)

print(a,b)
a. Syntax error
b. 1.0,4.0
c. 4.0,4.0
d. 4,4

94 Predict output for following code understandin


g

v1= True

v2=1

print(v1==v2, v1 is v2)

a) True False

b) False True

c) True True

d) False False

95 Evaluate the following expression and identify the Evaluation


correct answer.
16 // (4 + 2) * 5 + 2**3 * 4
a. 42
b. 46
c. 18
d. 32
96 Find output of following given program : Application
str1_ = "Aeiou"
str2_ = "Machine learning has no alternative"

for i in str1_:
if i not in str2_:
print(i,end='')

a) Au
b) ou
c) Syntax Error
d) value Error

97 Which of the following operator can not be used with Knowledge


string value
a) -
b) is
c) +
d) *

98 Find output for following given program Analysis


a=10
b=20
c=1
print(a !=b and not c)

a) 10
b) 20
c) True
d) False
99 Find output for following given program : Understandin
a=2 g
b=3
print( a*b**2)

a) 18
b) 16
c) 64
d)12

100 Observe the presence of operator * in following Analysis


program and predict the output:
list1=[10,20]
list2=[2,3]
list1= list1*list2[0]
print(list1)

a) Error
b)[20,40]
c)[10,10,20,20]
d)[10, 20, 10, 20]

101 Find output for following given code Evaluation


a=12
print(not(a>=0 and a<=10))

a) True
b) False
c) 0
d) 1
102 Evaluate expression in following given program and Evaluation
find the output :
a=56
b=a//7//4
print(b)

a. 0
b. 2
c. 0.0
d. 2.0

103 What output following program will produce Understandin


g
a=12
b=a%10
c=a%100

print(b,c)

A) 2 12
B) 12 2
C) 0 0
D) Error

104 What will be value of diff Application


c1='A'
c2='a'
diff= ord(c1)-ord(c2)
print(diff)

a) Error : unsupported operator ‘-’


b) 32
c)-32
d)0
105 What output following program will produce Evaluation
v1='1'
v2= 1
v3= v1==v2

a) Type Error
b) Value Error
c) True will be assigned to V3
d) False will be assigned to v3

106 What will be the value of the expression 13+12%14 Evaluation

(A) 14

(B) 25

(C) 13

(D) 27

107 How would you write xz in python. Knowledge

(A) x * z

(B) x^z

(C) x ** z

(D) None of the above

108 The expression 9/4/2 will evaluate equivalent to which of the Application
following expressions?

(A) 9/(4/2)

(B) (9/4)/2

(C) Both A and B

(D) None of the above


109 What will be the value of x? x= int(12.5 + 4/2) Evaluation

(A) 14

(B) 15

(C) Error

(D) 14.5

110 Which of the following operators has highest precedence: Knowledge

+,-,/,*,%,<<,>>,( ),**

(A**

(B) ( )

(C) %

(D)-

111 Which of the following results in an error? Analysis

(A) float(‘12’)

(B) int(‘12’)

(C) float(’12.5’)

(D) int(‘12.5’)

112 Which of the following is an invalid statement? Understanding

(A) xyz=1,000,000

(B) x y z = 100 200 300

(C) x,y,z=100,200,300

(D) x=y=z=1,000,000
113 What is the output of the following statements: Creation

A=5

B=6

print(A,B)

(A )5 6

(B) 5,6

(C) 5

(D) none of the above

114 What is the value of the expression 32% 3.0? Evaluation

(A) 2

(B) 2.0

(C) 10.6666

(D) 10

115 What is the output of the expression print(4.00/(2.0+2.0))? Understanding

(A) 1

(B) 1.0

(C) Error

(D) 1.00
116 What is the output of the following: Application

print(“Hello\nWorld”)

(A) Hello World

(B) Hello

World

(C) Hello

World

(D) None of the Above

117 Which of the following is an example of type casting? Understanding

(A) 3.2+5.3

(B) 2.0+5

(C) int(4.7)+3

(D) all of the above

118 What is the output of the following? Creation

S1=”my”

S2=”string”

print (int(s1+s2))

(A) my string

(B) mystring

(C) 2563859

(D) Error
119 What is the output of the following? Creation

print(“Python “, end= “ “)

print(“world”)

(A) Python world

(B) Python

world

(C) Python end world

(D) Python end

world

120 Evaluate the expression 6*2/5+5*2 Evaluation

(A) 2.4

(B) 2

(C) 12.4

(D) 12

121
Which of the following defines SyntaxError? Understanding

a) It is raised when the file specified in a


program statement cannot be opened.

b) It is raised when there is an error in the syntax of


the Python code.

c) It is raised when the requested module definition is


not found.

d) It is raised due to incorrect indentation in the


program code.
122
Which of the following defines ValueError? Understanding

a) It is raised when the file specified in a


program statement cannot be opened.

b) It is raised when there is an error in the syntax of


the Python code.

c) It is raised when a built-in method or operation


receives an argument that has the right data type
but mismatched or inappropriate values.

d) It is raised due to incorrect indentation in the


program code.

123
Which of the following defines IOError? Understanding

a) It is raised when the file specified in a


program statement cannot be opened.

b) It is raised when there is an error in the syntax of


the Python code.

c) It is raised when a built-in method or operation


receives an argument that has the right data type
but mismatched or inappropriate values.

d) It is raised due to incorrect indentation in the


program code.
124
Which of the following defines KeyboardInterrupt? Understanding

a) It is raised when the file specified in a


program statement cannot be opened.

b) It is raised when the user accidentally hits the Delete or


Esc key while executing a program due to which the
normal flow of the program is interrupted.

c) It is raised when a built-in method or operation


receives an argument that has the right data type
but mismatched or inappropriate values.

d) It is raised due to incorrect indentation in the


program code.

125
Which of the following defines ImportError? Understanding

a) It is raised when the file specified in a


program statement cannot be opened.

b) It is raised when there is an error in the syntax of


the Python code.

c) It is raised when the requested module definition is


not found.

d) It is raised due to incorrect indentation in the


program code.
126
Which of the following defines EOFError? Understanding

a) It is raised when the file specified in a


program statement cannot be opened.

b) It is raised when there is an error in the syntax of


the Python code.

c) It is raised when a built-in method or operation


receives an argument that has the right data type
but mismatched or inappropriate values.

d) It is raised when the end of file condition is


reached without reading any data by input().

127
It is raised when the denominator in a division operation is Understanding
zero.

a) IndexError

b) IndentationError

c) ZeroDivisionError

d) TypeError

128
It is raised when the index or subscript in a sequence is out Understanding
of range.

a) IndexError

b) IndentationError

c) ZeroDivisionError

d) TypeError
129
It is raised when a local or global variable name is not Understanding
defined.

a) IndexError

b) IndentationError

c) ZeroDivisionError

d) NameError

130
It is raised due to incorrect indentation in the program Understanding
code.

a) IndexError

b) IndentationError

c) ZeroDivisionError

d) NameError

131
It is raised when an operator is supplied with a value of Understanding
incorrect data type.

a) IndexError

b) TypeError

c) ZeroDivisionError

d) NameError
132
It is raised when the result of a calculation exceeds the Understanding
maximum limit for numeric data type.

a) OverFlowError

b) TypeError

c) ZeroDivisionError

d) NameError

133
ZeroDivisionError is a type of: Understanding

a) SyntaxError

b) Logical Error

c) Runtime Error

d) Other

134
IndentationError is a type of: Understanding

a) SyntaxError

b) Logical Error

c) Runtime Error

d) Other

135
KeyboardInterrupt is a type of: Understanding

a) SyntaxError

b) Logical Error

c) Runtime Error

d) Other
136
Which of following is not a decision-making statement. Knowledge,
Understanding
a. if-elif statement

b. for statement

c. if -else statement

d. if statement

137
In Python,...............................defines a block of statements. Knowledge,
Understanding
a. Block

b.loop

c.indentation

d.{}
138 if 4+5==10:
Knowledge
print(“TRUE”)
else: Application
print(“false”)
Evaluation
print (“True”)

a. False

True

b. True

True

c. false

d. none

139
Predict the output of the following code: Knowledge
X=3
Application
if x>2 or x<5 and x==6:
print(“ok”) Evaluation
else:
print(“no output”)

a . ok

b. okok

c. no output

d. none of above
140
The for loop in Python is an Knowledge,
Understanding
a. Entry Controlled Loop

b. Exit Controlled Loop

c. Both of the above

d. None of the above

141
The..................statement terminates the execution of the Knowledge,
whole loop. Understanding

a. continue

b. exit

c. breake

d. break

142
An empty /null statement in Python is ……………. Knowledge,
Understanding
a. pass

b. none

c. null

d. none
143
The................operator tests if a given value is contained in Knowledge,
a sequence or Understanding

not.

a. In:

b in

c. not in

d. none

144
The order of statement execution in the form of top to Knowledge,
bottom is known as Understanding
construct.

a. alternate

b.sequence

c.flow of data

d. flow chart
145
What will be the output of given Python code? Knowledge
str1="hello"
Application
c=0
for x in str1: Evaluation
if(x!="l"):
c=c+1
else:
pass
print(c)

a. 2

b. 0

c. 4

d. 3
146
State which of the following statement are true . Knowledge
1. If,elif ,else are not compound statement.
Application
2. Else if can be used in python.
3. Indentation while working with blocks is Evaluation
not necessary in python.
4. A pass statement is a null operation;it
does nothing.

a.1

b.2 ,3

c.3

d.4

147
In a Python program, a control structure: Knowledge,
Understanding
a. Defines program-specific data structures

b. Directs the order of execution of the statements in


the program

c. Dictates what happens before the program starts


and after it terminates

d. None of the above


148
Which of the following is False regarding loops in Python? Knowledge,
Understanding
a. Loops are used to perform certain tasks repeatedly.
Evaluation
b. while loop is used when multiple statements are to
executed repeatedly until the given condition
becomes true.

c. while loop is used when multiple statements are to


executed repeatedly until the given condition becomes
false

d. for loop can be used to iterate through the elements


of lists.
149

Why is iteration important? Knowledge,


Understanding
a. It determines the order in which instructions are
carried out

b. It allows multiple paths through a program

c. It allows code to be simplified by removing


repeated steps

d. It ensures the code works correctly


150
To access a list which contains ten elements, which of the Knowledge
following uses of
Application
range() would produce a list of the desired indexes?
Evaluation
a. range(1,10)

b. range(0,9)

c. range(10)

d. range(1,11)

151
Which statement is used to iterate itself over a range of Knowledge
values or a sequence

(A) if

(B) while

(C) do-while

(D) for

152
What abandons the current iteration of the loop? Understanding

(A) continue

(B) break

(C) stop

(D) infinite
153
Which of the following is not a loop statement in python? Knowledge,

(A) do-while

(B) while

(C) for

(D) all of these

154
Which of the following is a valid keyword? Knowledge,

(A) IF

(B) if

(C) If

(D) None of them

155
Symbol used to end the if statement is: Understanding

(A) ;

(B) :

(C) _

(D) #

156
A graphical representation of an algorithm to solve a given Knowledge,
problem:

(A) Flow chart

(B) Pie Chart

(C) Bar chart

(D) Column Chart


157
Which of the following is not a decision making statement? Understanding

(A) if-elif

(B) for

(C) if-else

(D) if

158
A loopthat never ends is called as Application

(A) infinite loop

(B) continue

(C) break loop

(D) none of them

159
Find the output of the following: Application

if True:

print(101)

else:

print(202)

(A) 101

(B) 202

(C) 303

(D) 102
160
Which of the following is false? Knowledge,

(A) oval shape in flowchart shows start or end point.

(B) Rectangle shows process

(C) Arrow shows connection between different parts of


the code

(D) diamond shows input/output

161
Which of the following is used as a dummy statement? Knowledge,

(A) pass

(B) pie

(C) if

(D) else

162
If and else are Application

(A) literals

(B) operators

(C) keywords

(D) none of them

163
How many statement must be present in a loop body . Analysis

(A) at least 2

(B) at least 1

(C) at least 4

(D) no required
164
Which is a jump statement? Application

A) break

(B) commit

(C) reflect

(D) do

165
loop is best when the no of iterations is known Analysis

(A) for

(B) if

(C) if else

(D) all of them

166
In a Python program, a control structure: Understanding

(A) Defines program-specific data structures.

(B) Directs the order of execution of the statements in


the program

(C) Dictates what happens before the program starts


and after it terminates.

(D) None of the above.


167
Can we write if/else into one line in Python? Analysis

(A) No

(B) Yes

(C) if/else not used in Python

(D) None of the above.

168
What keyword would you use to add an alternative Knowledge
condition to an if statement?

(A) else if

(B) elseif

(C) elif

(D) None of the above

169
Which one of the following is a valid Python if statement? Analysis

(A) if a>=9:

(B) if (a>=9)

(C) if (a=>9)

(D) if a>=9

170
Which statement will check if a is equal to b? Analysis

(A) if a=b:

(B) if a==b:

(C) if a===b:

(D) if a==b
171
What does the following source code print? Evaluation

if 4+5 == 10:

print (“True”)

else:

print (“False”)

print (“True”)

(A) True

(B) True

False

(C) False

True

(D) True

False

True
172
What does the following source code print? Evaluation

x = -100

if x < 100:

print (“The negative number”,x,”is not print here”)

print (“It is always printed”)

(A) It is always printed

(B) The negative number -100 is not print

here It is always printed

(C) The negative number -100 is not print here

(D) It will cause an error.


173
Given the nested if-else below, what will be the value Evaluation
x when the source code executed successfully:

x=0

a=5

b=5

if a>0:

if b<0:

x=x+5

elif a>5:

x=x+4

else:

x=x+3

else:

x=x+2

print (x)

(A) 0

(B) 4

(C) 2

(D) 3
174
Which code segment will NOT reach its print() function? Analysis

(A) if ‘yes’!=’no’:

print (“Condition met”)

(B) if ‘yes’ != ‘yes’:

print (“Condition met”)

(C) if not ‘yes’ = = ‘no’:

print (“Condition met”)

(D) if ‘yes’ = = ‘yes’:

print (“Condition met”)

175
What will be the output of following code fragment: Evaluation

a=input(“Enter a number”)

if (a = = 5):

print (“Five”)

else:

print (“Not Five”)

If input given is (i) 99 (ii) 5

(A) Not Five

(B) Five

(C) Cause error

(D) None of the above


176
What does the following Python program display? Evaluation

x=3

if x = = 0:

print (“Am I here?”,end=’ ’)

elif x = = 3:

print (“Or here?”, end=’ ‘)

else:

pass

print(“Or over here?”)

(A) Am I here ?

(B) Am I here ? Or here ?

(C) Or here ? Or over here?

(D) Am I here ? Or over here?

177
Which of the following is a pictorial representation of an Knowledge
algorithm?

(A) Pseudocode

(B) Program

(C) Flowchart

(D) Algorithm
178
Terminal symbol in a flowchart indicates: Analysis

(A) End

(B) Processing

(C) Input and Output

(D) Decision

179
In flowchart, diamond shaped symbol is used to represent: Understanding

(A) Decision box

(B) Statement box

(C) Error box

(D) if-statement box

180
Symbol used in flowchart such as rectangle with the Analysis
horizontal lines on two sides is used for:

(A) Defined statement

(B) Predefined process

(C) Error fix

(D) Variables defined


181
What is the result of executing the following code? Knowledge
and
application of
while loop
number = 5

while number <= 5:

if number < 5:

number = number + 1

print(number)

A. The program will loop indefinitely

B. The value of number will be printed exactly 1 time

C. The while loop will never get executed

D. The value of number will be printed exactly 5 times


182
What will the following code print? Knowledge
and
application of
while loop
counter = 1

sum = 0

while counter <= 6:

sum = sum + counter

counter = counter + 2

print(sum)

A. 12

B. 9

C. 7

D. 8
183
What will be printed by the following code when it Knowledge
executes? and
application of
sum = 0 for loop
values = [1,3,5,7]

for number in values:

sum = sum + number

print(sum)

A. 4

B. 0

C. 7

D. 16
184
What is the last thing printed when the following code is Knowledge
run? and
application of
while loop
number = 0

while number <= 10:

print("Number: ", number)

number = number + 1

A. Number: 10

B. Number: number

C. Number: 0

D. Number: 11
185
How many asterisks will be printed when the following Knowledge
code executes? and
application of
nested loop

for x in [0, 1, 2, 3]:

for y in [0, 1, 2, 3, 4]:

print('*')

A. 0

B. 4

C. 20

D. This is an infinite loop, so nothing will be printed


186
The following code contains an infinite loop. Which is the Knowledge
best explanation for why the loop does not terminate? and
application of
while loop

n = 10

answer = 1

while n > 0:

answer = answer + n

n=n+1

print(answer)

A. n starts at 10 and is incremented by 1 each time through


the loop, so it will always be positive.

B. answer starts at 1 and is incremented by n each time, so


it will always be positive.

C. You cannot compare n to 0 in the while loop. You must


compare it to another variable.

D. In the while loop body, we must set n to False, and this


code does not do that.
187
Which type of loop can be used to perform the following Knowledge
iteration: You choose a positive integer at random and and
then print the numbers from 1 up to and including the application of
selected integer. while loop and
for loop

A. a for-loop or a while-loop

B. only a for-loop

C. only a while-loop

188
Which of the following statements won’t be printed when Knowledge
this Python code is run? and
application of
for loop
for letter in 'Python':

if letter == 'h':

continue

print('Current Letter : ' + letter)

A. Current Letter : P

B. Current Letter : t

C. Current Letter : h

D. Current Letter : o
189
What will the following code print? Knowledge
and
def mystery(str): application of
for loop
out = ""

for char in str:

if char == "i":

break

if char == 'a':

continue

out += char

return out

print(mystery("walking"))

A. walking

B. wlking

C. wlk

D. wlkng
190
Which of the following will print five rows with five ‘*’ in Knowledge
each row? and
application of
1. range()
for i in range(0,5):

print("*" * i)

2.

for i in range(0,5):

print("*" * 5)

3.

for i range(1,5):

print("*" * i)

4.

for i in range(1,5):

print("*" * 5)

A. 1.

B. 2.

C. 3.

D. 4.
191
What will the following code print? Knowledge
and
application of
nested for loop
for i in range(1,4):

for j in range(1,4):

print(i, j, end=' ')

A. 1 1 2 2 3 3

B. 1 2 3 1 2 3 1 2 3

C. 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3

D. 1 1 2 1 3 1 2 1 2 2 2 3 3 1 3 2 3 3

192
What will be the output of the following Python code? Knowledge
and
application of
for loop
for i in range(0,2,-1):

print("Hello")

A. Hello

B. Hello Hello

C. No Output

D. Error
193
Which of the following is a valid for loop in Python? Knowledge
and
application of
for loop
A. for(i=0; i < n; i++)

B. for i in range(0,5):

C. for i in range(0,5)

D. for i in range(5)

194
When does the else statement written after loop executes? else
Statements and
it’s use
A. When break statement is executed in the loop

B. When loop condition becomes false

C. Else statement is always executed

D. None of the above

195
Flowchart and Algorithms are used for Knowledge
and
A. Better Programming application of
Flowchart
B. Easy Testing and Debugging

C. Efficient Coding

D. All
196 Which of the following is a valid for loop in Python? Knowledge

(A) for(i=0; i<n; i++)

(B) for i in range(0, 5):

(C) for i in range(0, 5)

(D) for(i=0; i<n; i++):

197 What will be the output of the following Python Knowledge

code? x = “abcdef”

i = “i”

while i in x:

print(i, end=“ ”)

(A) a b c d e f

(B) abcdef

(C) i i i i i ….

(D) No output
198 What will be the output of the following Python Understanding

code? x = 12

for i in x:

print(i, end=“”)

(A) 12

(B) 1 2

(C) 2 1

(D) Error

199 What will be the output of the following Python code? Analysis

for x in range(1, 4):

for y in range(2, 5):

if x * y > 6:

break

print(x*y, end=“#”)

(A) 2#3#4#4#6#8#6#9#12#

(B) 2#3#4#5#4#6#6#

(C) 2#3#4#4#6#6#

(D) 2#3#4#6
200 What will be the output of the following Python Knowledge

code? i = 0

sum = 0

while i < 9:

if i%4 == 0:

sum = sum + i

i=i+2

print(sum)

(A) Infinite Loop

(B) 12

(C) 14

(D) 10

201 Which of the following is considered as an infinite loop? Understanding

(A) while(infinite):

(B) while(1):

(C) while(False):

(D) while(not True):


202 What is the result of executing the following code? Application

count = 10

while count <= 10:

if count < 10:

Count = count + 1

print(count)

(A) The value of count will be printed exactly one(1) time.

(B) The while loop will never be executed.

(C) The program will run indefinitely.

(D) The value of count will be printed exactly nine(9) times.

203 When does the else statement written after the for loop Understanding
execute?

(A) When a break statement is executed in the loop

(B) else statement is always executed

(C) When loop condition becomes false

(D) When a continue statement is executed in the loop


204 Which of the following symbols is used to represent decision Knowledge
making in flowcharts?

(A)

(B)

(C)

(D)

205 What will be the output of the following Python code? Application

num = 0

for num in range(6):

num = num + 1

if num == 3:

continue

print(num, end=“ ”)

(A) 1 2 3 4 5 6

(B) 0 1 2 4 5

(C) 1 2 4 5 6

(D) 0 1 2 3 4 5
206 What will be the output of the following Python code? Application

num = 4

for i in range(1, num + 1):

for j in range(1, i +

1):

print(j, end=“ ”)

print(“## ”)

(A) 1 ## 1 2 ## 1 2 3 ## 1 2 3 4 ##

(B) 1 ## 1 2 ## 1 2 3 ## 1 2 3 4 ## 1 2 3 4 5 ##

(C) 1 ## 2 3 ## 3 4 5 ## 6 7 8 9 ##

(D) 1 ## 1 1 ## 1 1 1 ## 1 1 1 1 ##
207 What will be the output of the following Python code? Application

num = 5

m=1

if num < 0:

print(“wrong input”)

elif num == 0:

print(1)

else:

for i in range(1, num + 1):

m=m*i

print(m)

(A) wrong input

(B) 5

(C) 120

(D) 720
208 X wants to allow the program to repeatedly ask the user to Application
enter their Choice if it does not equal the Answer. Which loop
option should X use?

(A) while Choice =

Answer: Choice =

input()

(B) while Choice !=

Answer: Choice =

input()

(C) while Choice =!

Answer: Choice =

input()
209
(D) while Choice ==

Answer: Choice =

input()

Which of the following loops is not supported by the python Knowledge


programming language?

(A) for loop


210 How would you create a loop to iterate over the contents of Application
the list given as monthDays = [31, 28, 31, 30, 31, 30, 31, 31,
30, 31, 30, 31] and print out each element?

(A) for days in

range(monthDays):

print(days)

(B) for days in

monthDays:

print(days)

(C) for days in

range(len(monthDays)):

print(days)
211
(D) for days in

monthDays:

print(monthDays)

What will be the result of the following command:- Applying

>>>"i love python".capitalize()


212
The following string function returns True if the Analysing
characters in the strings are:

>>>str.isalnum()

(A) alphabets only

(B) numbers only

(C) alphabet and number only

(D) Alphabet and Space Only

213
What will be the output of the following command: Evaluating

>>>string= "A quick fox jump over a lazy fox"

>>>string.find("fox",9,34)

(A) 28

(B) 29

(C) 8

(D) 7
214
Raman is using string.isspace() in his command, Help him Applying
to choose the correct option.

>>>string=”Gagan Pandey”

>>>string.isspace( )

(A) string.isspace() returns True

(B) string.isspace() returns False

(C) Error

(D) None of the above

215
Kavita is using string.isdigit( ) in his command, Help him Understanding
to choose the correct option.

(A) “123abc”.isdigit( ) returns True

(B) “123abc”.isdigit( ) returns False

(C) “123abc”.isdigit( ) gives Error

(D) None of the above


216
What will be the output of the following command:- Evaluating

>>>string=”saregamapadhanisa”

>>>string.lstrip(“tears”)

(A) “regamapadhanisa”

(B) “Saregamapadhanisa”

(C) “gamapadhanisa”

(D) “gamapadhanisa”

217
Find the length of the following string using len( ) : Applying

>>>str= “World in Shock.”

(A) 14
(B) 15
(C) 16
(D) 17

218
Which one is the correct way of finding length of string Understanding
in python:-
(A) >>> “python”.len( )
(B) >>> length=“python”.len( )
(C) >>>len(“python”)
(D) >>>length(“python”)
219
Function “string.islower()” is used to :- Understanding
(A) To find the first lower case character in the string
(B) To check whether string is in lower case of not
(C) To convert the string into lower case.
(D) Display the strings lowercase character only

220
String function rstrip( ) matches from Understanding
(A) Left to right
(B) Both from right and left
(C) Right to left
(D) Matches from anywhere

221
What will be the output of the following Code: Understanding

>>>"India is my Country. I love my Country


India".replace("Country","India")

(A) India is my Country. I love my Country India".

(B) Country is my Country. I love my Country Country

(C) 'India is my India. I love my India India'

(D) ERROR
222
The return type of string.split() is a Analysing
(A) string
(B) List
(C) Tuple
(D) Dictionary

223
Write the correct code for the following output:- Applying

Output: 'W$O$R$L$D'

(A) >>>str="$"

>>>str.join("WORLD")

(B) >>>str="$"

>>> join("WORLD",’$’)

(C) >>> "$" = str

>>> join("WORLD",’$’)

(D) >>>str="$"

>>> join("WORLD").str
224
The return type of x in the below code is Understanding

txt = "I could eat bananas all day"

x = txt.partition("bananas")

(A) string
(B) List
(C) Tuple
(D) Dictionary

225
The number of element return from the partition function Analysing
is

>>>“I love to study python”.partition("study")


(A) 1
(B) 3
(C) 4
(D) 5

226 Knowledge
Which of the following commands will create a list?

a) list1 = list()

b) list1 = []

c) list1 = list([1, 2, 3])

d) all of the above


227 Knowledge
What is the output when we execute list(“hello”)?

a) [‘h’, ‘e’, ‘l’, ‘l’, ‘o’].

b) [‘hello’].

c) [‘llo’].

d) [‘olleh’].

228 Knowledge
Suppose str1 is [‘h’,’e’,’l’,’l’,’o’], what is output of
len(str1)?

a) 5

b) 4

c) None

d) Error

229 Knowledge
Suppose list1 is [1, 5, 9], what is sum (list1) ?

a) 1

b) 9

c) 15

d) Error
230 Knowledge
Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the
following is correct syntax for slicing operation?

a) print(list1[0])

b) print(list1[:2])

c) print(list1[:-2])

d) all of the mentioned

231 Knowledge
Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1] ?

a) Error

b) None

c) 25

d) 2

232 Knowledge
Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1] ?

a) [2, 33, 222, 14].

b) Error

c) 25

d) [25, 14, 222, 33, 2].


233 Knowledge
What is the output when following code is executed ?

>>>names = ['Amir', 'Bear', 'Charlton', 'Daman']

>>>print(names[-1][-1])

a) A

b) Daman

c) Error

d) n

234 Knowledge
Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is :

a) [0, 1, 2, 3].

b) [0, 1, 2, 3, 4].

c) [0.0, 0.5, 1.0, 1.5]

d) [0.0, 0.5, 1.0, 1.5, 2.0].


235 Knowledge
What is the output when following code is executed ?

>>>list1 = [11, 2, 23]

>>>list2 = [11, 2, 2]

>>>list1 < list2 is

a) True

b) False

c) Error

d) None

236 Knowledge
To add a new element to a list we use which command ?

a) list1.add(5)

b) list1.append(5)

c) list1.addLast(5)

d) list1.addEnd(5)

237 Knowledge
To insert 5 to the third position in list1, we use which
command ?

a) list1.insert(3, 5)

b) list1.insert(2, 5)

c) list1.add(3, 5)

d) list1.append(3, 5)
238 Knowledge
Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after
list1.reverse() ?

a) [3, 4, 5, 20, 5, 25, 1, 3].

b) [1, 3, 3, 4, 5, 5, 20, 25].

c) [25, 20, 5, 5, 4, 3, 3, 1].

d) [3, 1, 25, 5, 20, 5, 4, 3]

239 Knowledge
What is the output when the following code is executed ?

>>>"Welcome to Python".split()

a) [“Welcome”, “to”, “Python”].

b) (“Welcome”, “to”, “Python”)

c) {“Welcome”, “to”, “Python”}

d) “Welcome”, “to”, “Python”

240 Knowledge
What is the output when following code is executed?

>>>list("a#b#c#d".split('#'))

a) [‘a’, ‘b’, ‘c’, ‘d’].

b) [‘a b c d’].

c) [‘a#b#c#d’].

d) [‘abcd’].

241
242

243

244

245

246

247

248

249

250

251

252

253

254

255
256

257

258

259

260

ANSWER

Question No Answer
Q.No.1 C
Q.No.2 A
Q.No.3 B
Q.No.4 C
Q.No.5 B
Q.No.6 B
Q.No.7 C
Q.No.8 D
Q.No.9 A
Q.No.10 D
Q.No.11 B
Q.No.12 C
Q.No.13 B
Q.No.14 D
Q.No.15 C

16
Answer:- A

17
Answer:- D

18
Answer:- C

19
Answer:- C

20
Answer:- C

21
Answer:- A

22 Answer:- C

23 Answer:- C

24 Answer:- B

25 Answer:- B

26 Answer:- C

27 Answer:- A

28 Answer:- C
29
Answer:- B

30
Answer:- B

31 Python is an open source language

32 ABC language and Modula 3

33 Python was released in February 1991

34 Cross-platform

35 Interpreter

Python shell
36

>>>
37

Error
38

23.0
39

150+300
40

Indentation
41

One
42

Not a case-sensitive
43
44 Source code

45 Integrated Development and Learning Environment

46 (D) None of these

47 (A) eval

48 (A) Lower case

49 (B) in

50 (B)a**b

(B) Guido van Rossum


51

(C) 1989
52

(A) .py
53

(C) #
54

(D) class
55

(A) List
56

(B) //
57

(C) parenthesis
58

(D) abc
59
60 (B) 24

61
A

62
B

63
C

64
B

65
A

66
D

67 B

68 D

69 B

70 C

71 C

72 D

73 C
74
C

75
D

76 A

77 D

Explanation: int() will convert the float value into integer value.

78 D

79 D

Explanation: None of the above is False regarding data types in Python.

80 C

Explanation: type() function is used to know the data type of a variable


in Python.

C
81

A
82

B
83

C
84
85 B

Explanation: The values of a dictionary can be accessed using keys but


vice versa is not true

86 A

Explanation: A dictionary key must be immutable. You can use a tuple


as a key if all of the elements contained in the tuple are immutable.

87 B

Explanation: List is mutable and Tuple is immutable. A mutable data


type means that a python object of this type can be modified

88 D

89 C

Explanation: Dictionary is the collection of keys and their value.

90 C

Explanation: Indexing is not valid in dictionary.

91 C) not

b) or
92

b) 1.0,4.0
93
94 a) True False

95 42

96 a) Au

97 a)-

98 d) False

99 a)18

100 d)[10, 20, 10, 20]

a) True
101

b)2
102

A) 2 12
103

c)-32
104

d) False will be assigned to v3


105

(B) 25
106

( C ) x**z
107

(B) (9/4)/2
108
109 (A)14

110 (B) ( )

111 (D) int(‘12.5’)

112 (B) x y z = 100 200 300

113 (A ) 5 6

114 (B) 2.0

115 (B) 1.0

(C) Hello
116
World

(C) int(4.7)+3
117

(D) Error
118

(A) Python world


119

(C) 12.4
120

121 b

122 c

123 a
124
b

125
b

126
d

127
c

128
a

129
d

130
b

131 b

132 a

133 b

134 a

135 c

136 (b)

137 (c)

138 (b)
139
(c)

140
(a)

141
(d)

142
(a)

143
(b)

144
(b)

145
(d)

146 (d)

147 (b)

148 (c)

149 (c)

150 (c)

151 D

152 A
153
A

154
B

155
B

156
A

157
B

158
A

159
A

160 D

161 A

162 C

163 B

164 A

165 A

166 (B) Directs the order of execution of the statements in the program

167 (B) Yes


168
(C) elif

169
(A) if a>=9:

170
(B) if a==b:

171
(C) False

True

172
(B) The negative number -100 is not print here

It is always printed

173
(D) 3

174
(B) if ‘yes’ != ‘yes’:

print (“Condition met”)

175 (A) Not Five

176 (C) Or here ? Or over here?

177 (C) Flowchart

178 (A) End

179 (A) Decision box

180 (B) Predefined process


181 A

182 B

183 D

184 A

185 B.

186 C

187 A

C
188

C
189

B
190

C
191

C
192

B
193

B
194
195 D

196 (B) for i in range(0, 5):

197 (D) No output

198 (D) Error

199 (C) 2#3#4#4#6#6#

200 (B) 12

201 (B) while(1):

(C) The program will run indefinitely.


202

(C) When loop condition becomes false


203

(C)
204

(C) 1 2 4 5 6
205

(A) 1 ## 1 2 ## 1 2 3 ## 1 2 3 4 ##
206

(C) 120
207

(B) while Choice != Answer:


208
Choice = input()

209 (C) do…...while loop

210 (B) for days in monthDays:

print(days)

211
(B)

212
(C)

213
(B)

214
(B)

215 (B)

216 (D)

217 (B)

218 (C)

219 (B)

220 (C)
221
(C)

222
(B)

223
(A)

224
(C)

225
(B)

226 d) all of the above

227 a) [‘h’, ‘e’, ‘l’, ‘l’, ‘o’].

a) 5
228

c) 15
229

d) all of the mentioned


230

c) 25
231

d) [25, 14, 222, 33, 2].


232

d) n
233

234 c) [0.0, 0.5, 1.0, 1.5]

235 b) False
236
b) list1.append(5)

237
a) list1.insert(3, 5)

238 d) [3, 1, 25, 5, 20, 5, 4, 3]

239
a) [“Welcome”, “to”, “Python”].

240
a) [‘a’, ‘b’, ‘c’, ‘d’].

241

242

243

244

245

246

247

248

249
250

251

252

253

254

255

256

257

258

259

260

Name of the vetter – AVISEK

PAL Name of the KV- IOC

HALDIA Region- KOLKATA


Mobile No- 8777025554

E-mail ID – pal.avisek@gmail.com
Name of the Chapter- Python Revision Tour

Questi Question Content Learning Objective(if


on No Provided)
1 Assertion: It is interpreted language. Understanding
Reason: Python programs are executed by an interpreter.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
2 Assertion: Python is portable and platform independent. Evaluation
Reason: Python program can run on various operating
systems and hardware platforms.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
3 Assertion: Python has a rich library of predefined Application
functions.
Reason: Python is helpful in web development.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
4 Assertion: Python programs are easy to understand. Analysis
Reason: Python programs have a clearly defined syntax
and relatively simple structure.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
5 Assertion: Python is case-sensitive. Evaluation
Reason: Python does not use indentation for blocks and
nested blocks.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
6 Assertion:- Python can be downloaded and distributed. Analysis
Reason:- Python is a Free and Open Source Language.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
7 Question Analysis,
Assertion: Python program is executed line by line.
Reason: Python is compiled language.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
8 Question Analysis,
Assertion: Python is an object oriented language
Reason: Python is a cross platform language
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
9 Question Analysis,
Assertion: Python can be used in interactive mode
Reason: Python can be used in script mode
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
10 Question Analysis,
Assertion ‘HELLO is a valid string
Reason: String is enclosed in single quote (‘ ‘)
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
11 Assertion: Python is Portable. Understanding
Reason: Python programs can run on various platforms
without affecting its performance
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
12 Assertion: Python is case-sensitive. Understanding
Reason: NUMBER and number are not same in Python
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
13 Assertion: Python is a high-level object-oriented Analysis
programming language.
Reason: It can run on different platforms like Windows,
Linux, Unix, and Macintosh
(A) Both Assertion and reason are True
(B) Only Assertion is true reason is False
(C) Assertion is False but reason is True
(D) Both Assertion and reason are False

14 >>>print('Good'+' Morning') Evaluation


#Output :Goodmorning
Assertion: incorrect Output
Reasoning: There is a syntax error
(A) Both Assertion and reason are True
(B) Only Assertion is true reason is False
(C) Assertion is False but reason is True
(D) Both Assertion and reason are False
15 Assertion: An interpreter processes the program Evaluation
statements one by one
Reasoning: Python uses an interpreter to convert its
instructions into machine language
(A) Both Assertion and reason are True
(B) Only Assertion is true reason is False
(C) Assertion is False but reason is True
(D) Both Assertion and reason are False

16 Assertion: Interactive mode of working means you type


the command – one command at a time
Reason: In Intractive mode you have to type the
command in fron of python command prompt
17 Assertion: In Python comments are interpreted and are
shown on the output screen.
Reason: Single line comments in python starts with #
character

18 Assertion: Python uses the concept of L-value and


R-value, that is derived from the typical mode of
evaluation on the left and right side of an assignment
statement
Reason: name = ‘Riya’
In above code the value ‘Riya’ is fetched (R
value) and stored in the variable named – name (L value)

19 Assertion: Python allows us to assign multiple values to


multiple variables in a single statement
Reason: In a single python statement individual variables
are assigned values by separating them with coma ‘,’.
Example: a = 3, b = 4

20 Assertion: A token is the smallest unit in a program


Reason: Tokens acts as a logical unit which is meaningful
to the compiler or interpreter.

Assertion (A): x= 12345678

Print (x)

Here, x is integer variable


Application
Reason (R): Integer variables are used to store numeric
data
21
(A) Both A and R are true and R is the correct
explanation of assertion.

(B) A and R both are true but R is not the correct


explanation of A .

(C) A is true, R is false.

(D) A is false, R is true.

Assertion (A): print(13%5)

22 Ans: 2.6
Evaluation

Reason (R): Modulus operation returns remainder as


result

(A) Both A and R are true and R is the correct


explanation of assertion.

(B) A and R both are true but R is not the correct


explanation of A .

(C) A is true, R is false.

(D) A is false, R is true.

Assertion (A): Age=18


23
print(age)

Reason (R): Variables are case sensitive Application

(A) Both A and R are true and R is the correct


explanation of assertion.

(B) A and R both are true but R is not the correct


explanation of A .
(C) A is true, R is false.

(D) A is false, R is true .

Assertion (A): a,b,c=1,2,3

Here a,b,c are l-values Knowledge

24 Reason (R): l-value is an assignable object and occurs on


the left side of the assignment operator.

(A) Both A and R are true and R is the correct


explanation of assertion.

(B) A and R both are true but R is not the correct


explanation of A .

(C) A is true, R is false.

(D) A is false, R is true.

Assertion (A): #print(“Kendriya Vidyalaya”)

Reason (R): Comments are executed by program

(A) Both A and R are true and R is the correct


25 explanation of assertion. Understand

(B) A and R both are true but R is not the correct


explanation of A .

(C) A is true, R is false.

(D) A is false, R is true.

26. Assertion (A) :


s = (11, 12, 13, 14)
s[1] = 15
The statement s[1] is not correct.

Reasoning (R) :
Tuple is immutable.
(a) Both A and R are
true and R is the
correct
explanation of A
(b) Both A and R are
true and R is not
the correct
explanation of A
(c) A is true , but R is
is false
(d) A is false , but R is
true

27∙ Assertion (A) :


s = [11, 12, 13, 14]
s[1] = 15

Reasoning (R) : List is immutable.


(a) Both A and R are
true and R is the
correct
explanation of A
(b) Both A and R
are true and R is
not the correct
explanation of A
(c) A is true, but R is
is false
(d) A is false, but R is
true

28∙ Assertion (A) :


s = {11, 12, 13, 14}
s[1] = 15
The statement s[1] is correct.

Reasoning (R) : Set is immutable

(a) Both A and R are


true and R is the
correct
explanation of A
(b) Both A and R are
true and R is not
the correct
explanation of A
(c) A is true, but R is
is false
(d) A is false, but R is
true

29∙ Assertion (A) :


>>> print(type((3 + 33)<-(-4 - 44)))
<class 'bool'>

Reasoning (R) : As output is True which is a boolean value


(a) Both A and R are
true and R is the
correct
explanation of A
(b) Both A and R are
true and R is not
the correct
explanation of A
(c) A is true, but R is
is false
(d) A is false, but R is
true

30∙ Assertion (A) : List is only sequence which is mutable in nature

Reasoning (R) : Sequences are of three types : list, tuple, set.


All are mutable in nature as its value can be changed.
(a) Both A and R are
true and R is the
correct
explanation of A
(b) Both A and R are
true and R is not
the correct
explanation of A
(c) A is true, but R is
is false
(d) A is false, but R is
true

31 a=(1,2,3) Evaluation
a[0]=4

Assertion:The above code will result in error

Reason: Tuples are immutable. So we cant change them.


(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
32 Assertion: Elements can be added or removed from a list Evaluation
Reason: List is an immutable datatype.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
33 num1=input(“enter a number”) Evaluation
print(num1+2)

Assertion: The above code will give error message when


executed.

Reason: input() returns a string datatype. We cannot


add string datatype with a numeric datatype. So
performing arithmetic operation on it will result in
error.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
34 var1=10 Evaluation
var1=”hello”

Assertion: The above code is invalid. We can not assign a


data of different data type to an existing variable.
Reason: Python supports implicit type casting. So it is
possible to assign a data of different data type to an
existing variable.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
35 num1 = '5' + '5' Evaluation
print(num1)
Assertion:The above code is valid and we can use the '+'
operator with 2 string.
Reason: The + operator when used with strings,
concatenates the strings

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
36 Assertion: Datatypes are used to identify the types of Understanding
Data
Reason: Data types are two types as numbers as strings
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
37 Assertion: String is sequence datatype. Application
Reason: A python sequence is an ordered collections of
items where each item is indexed by an integer.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
38 Assertion: Dictionary in Python holds data items in Application
key-value pairs Reason: Immutable means they cannot be
changed after creation.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
39 Assertion: Variables whose values can be changed after Knowledge
they are created and assigned are called immutable.
Reason: 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.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
40 Assertion: List can be changed after creation Analysis
Reason: List is mutable datatype.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
41 Assertion (A):To do arithmetic python uses arithmetic(+,*,//,**, 1
-, / ,%)
Reson(R):Each of these operators is a binary operator
a) A and B are True
b) A is the explanation of B
c) A is true B is false
d) B is true A is false

42 Assertion (A): the relational operator determine the relation 1


among ,different operand
Resson(R):It returns the boolean value
a) A is the explanation of B
b) A and B is true
c) A is not Explanation of B
d) All statements is True

43 Assertion(A):There are two identity operators are used to check


if both the operands reference the same memory
Ression(R):The identity operators compare the memory
locations of two objects
a) A is True only
b) B is true only
c) A and B is true
d) B is True and A is False

44 Assertion(A):not has a lower priority than non-Boolean


operators
Resson(R): so not a==b is interpreted as not(a==b)
a) A is false
b) B is true
c) Both statements are True
d) A is the Explanation of B

45 A: The ** operators is evaluated from right to left R: 1


All operators are left associative
a) A is wrong
b) B is wrong
c) A is not Explanation of B
d) A and B are correct
46 Assertion (A ) : Evaluation
for the given expression
v1='1'
v2= 1
v3= v1==v2
value of v3 is false
Reasoning (R): Integer value can not be compared with string
value

A) Both A and R are true and R is correct explanation of A


B) Both A and R are true but R is not correct explanation of
A
C) Only A is True but R is false
D) Only R is True and A is false
47 Assertion (A ) : Application
following given expression will result into
TypeError
str1="ABC"
v1=[2]
str3=str1*v1

Reasoning (R): operator ‘*’ can not be applied on string

A) Both A and R are true and R is correct explanation of A


B) Both A and R are true but R is not correct explanation of
A
C) Only A is True but R is false
D) Only R is True and A is false

48 Assertion (A ) : Following given expression will produce Creation


output 2
v1=1
v2=True
print(v1+v2)

Reasoning (R): Boolean data value 1,0 are considerd subtype


of integer
and hence implicit type casting takes place
whenever
integer and boolean values are used together
in an expression

A) Both A and R are true and R is correct explanation of A


B) Both A and R are true but R is not correct explanation of
A
C) Only A is True but R is false
D) Only R is True and A is false
49 Assertion (A ) : And operator is applicable on two Knoweldge
operands and not is
applicable on one operand only
Reasoning (R): And is binary operator and not is a unary
operator

A) Both A and R are true and R is correct explanation of A


B) Both A and R are true but R is not correct explanation of
A
C) Only A is True but R is false
D) Only R is True and A is false

50 Assertion (A) : Following code will result into output : Creation


True
a=[10,20]
b=a[:]
print( a is b)
Reasoning (R): is is used for checking whether or not both
the
operands is using same memory location

A) Both A and R are true and R is correct explanation of A


B) Both A and R are true but R is not correct explanation of
A
C) Only A is True but R is false
D) Only R is True and A is false
51 Assertion: int(‘A’) Understanding
The above statement will result into error
Reason: ‘A’ is not recognised by Python
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
52 Assertion: S1: (3*3)**3 Apllication
S2: 3*(3**2)
Both S1 and S2 will produce same result
Reason: Both * and ** have same precedence
(A) Both Assertion and reason are true
(B) Assertion and reason both are false
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
53 Assertion: a=9 Analysis
b=int(9.2)
Both a and b have same value
Reason: b is converted to integer explicitly
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
54 Assertion: bool(0) results to False Knowledge
Reason: Boolean of 0 is false
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
55 Assertion: a=’3’ Application
b=’2’
c=a+b
The value of c will be 5
Reason: ‘+’ operator adds integers but
concatenates strings
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
56 Assertion: In an expression, associativity is the solution to
the order of evaluation of those operators which clashes Analysis
due to same precedence.
Reason: Operators in an expression may have equal
precedence due to which the order of evaluation can not
be decided just by precedence.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
57 Assertion: Program must be interactive for the user. Creation
Reason: Programs are executed in the main memory of
the system.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
58 Assertion: An identifier can not have the same name as of
a keyword. Analysis
Reason: Python interpreter will not be able to
differentiate between a keyword and an identifier having
the same name as of a keyword.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
59 Assertion: python require each statement typed on a
separate line. Analysis
Reason: python has no statement terminator, so there is
no way to differentiate between two statements typed on
the same line
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
60 Assertion: In a program, there is no need to compare two Analysis
values.
Reason: Two values are compared using relational
operators.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

61 Assertion: Logical operators works on Boolean values.


Reason: Boolean values are true and false. Analysis
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
62 Assertion: Program must be interactive for the user. Creation
Reason: Programs are executed in the main memory of
the system.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
63 Assertion: An identifier can not have the same name as of
a keyword. Analysis
Reason: Python interpreter will not be able to
differentiate between a keyword and an identifier having
the same name as of a keyword.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
64 Assertion: python program begins where the first line of
code appears. Analysis
Reason: Python program does not have a main function.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
65 Assertion: input() and output() are built in functions of Analysis
python.
Reason: python has many built in functions that works
without importing a package.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

66 A: SyntaxError: Missing parentheses in call to ‘print’. Analysis


R: SyntaxError: It is raised when there is an error in the
syntax of the Python code.
a) Both A and R are true and R is the
correct explanation of A
b) Both A and R are true and R is not the
correct explanation of A
c) A is true , but R is false
d) A is false , but R is true
e) Both A and R are False
67 A: NameError: name 'X' is not defined Analysis
R: NameError: It is raised when the requested module
definition is not found.
a) Both A and R are true and R is the
correct explanation of A
b) Both A and R are true and R is not the
correct explanation of A
c) A is true , but R is false
d) A is false , but R is true
e) Both A and R are False
68 A: a =10 Analysis
b = 20
if a > b:
print “A is greater”
R: SyntaxError: Missing parentheses in call to ‘print’.
a) Both A and R are true and R is the
correct explanation of A
b) Both A and R are true and R is not the
correct explanation of A
c) A is true , but R is false
d) A is false , but R is true
e) Both A and R are False
69 A: ZeroDivisionError: division by zero Analysis
R: ZeroDivisionError: It is raised when the denominator
in a division operation is zero.
a) Both A and R are true and R is the
correct explanation of A
b) Both A and R are true and R is not the
correct explanation of A
c) A is true , but R is false
d) A is false , but R is true

e) Both A and R are False


70 A: TypeError: can only concatenate str (not "int") to str Analysis
R: TypeError: It is raised when an operator is supplied with
a value of incorrect data type.
a) Both A and R are true and R is the
correct explanation of A
b) Both A and R are true and R is not the
correct explanation of A
c) A is true , but R is false
d) A is false , but R is true
e) Both A and R are False
71. Assertion: It is not necessary to always create the file in Knowledge
the same default folder where Python has been installed.
Reason: In binary file, there is no delimiter for a line. (A)
Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
72. Assertion: The relative paths are relative to current Knowledge
working directory.
Reason: The relative path for a file always remains same
even after changing the directory.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

73. Assertion: When you open a file for writing, if the file Understanding
does not exist, an error occurs.
Reason: When you open a file for writing, if the file
exists, the existing file is overwritten with the new file.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
74. Assertion: The offset argument to seek() method indicates Understanding
the number of bytes to be moved.

Reason: If the offset value is set to 2, beginning of the


file would be taken as seek position
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

75. Assertion: Every record in a CSV file is stored in reader Knowledge


object in the form of a list.

Reason: writerow() method allows us to write a list of


fields to the CSV file.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
76. Assertion: To indicate an iterative block of code in
Python, one must indent each line of the block by the Knowledge,
same amount. Understanding
Reason: Python is a case-sensitive programming Application
language .
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
77. Assertion: Loops are used to run same code again and
Knowledge,
again.
Understanding
Reason: Iteration statements(loop) are used to execute a Application
block Evaluation
of statements as long as the condition is true.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
78 Assertion: An example of an infinite loop is : while(1):
Knowledge,
Reason: A loop that continues repeating without a
Understanding
terminating
Application
(ending) condition is an infinite loop.
Evaluation
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
79 Assertion: The statements within the body of for loop are
Knowledge,
executed till the range of values is exhausted.
Understanding
Reason: for loop can not be nested.
Application
(A) Both Assertion and reason are true and reason is
Evaluation
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
80 Assertion: Indentation while working with blocks is not
Knowledge,
necessary in python.
Understanding
Reason: Indentation defines the scope of a control
Application
structure in the program.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
81 Analyse the following code: Analysis

for i in range(1,4):
for j in range (1,i+1):
print(j,end=’ ’)
print()

Assertion: output is
1
12
123
Reason: here, range function will generate value 1,2,3 in
the outer loop and the inner loop will run for each value
of “i” used in outer loop.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
82 Code to analyse: Analysis /
IF Application
True:
Print(103)

Assertion: Shows error

Reason: IF is not a valid keyword in Python.


(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
83 Assertion: A flow chart is made before starting coding Analysis /
for a particular problem. Application

Reason: Flow chart is mandatory in python.


(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
84 Assertion: In a flow chart stop statement is written in Analysis /
oval shape. Application

Reason: Start/End of any logic is given by oval shape


only.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
85 Analyse the code below: Analysis /
a=5 Evaluation
while a>0:
print(a)
print(“thank you”)
Assertion: This is a infinite loop.
Reason: A loop becomes an infinite loop if a condition
never becomes false.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
In the following questions, a statement of assertion is
followed by a
statement of reason. Mark the correct choice as.
(A) If both assertion and reason are true and reason is the
correct
explanation of assertion.
(B) If both assertion and reason are true but reason is not
the correct
explanation of assertion.
(C) If assertion is true but reason is false.
(D) If both assertion and reason are false.
86 Assertion: Indentation in Python is very important when Understanding
user use compound statements.
Reason: Indent all statements in one block at the same
block.
87 Assertion: If condition is True then first statement gets Analysis
executed
Reason: Execution of statements depends on condition.
88 Assertion: Multiple condition can not be checked in Evaluation
Python.
Reason: elif keyword is not used to check another
condition.
89 Assertion: Flowhcart is a pictorial representation. Knowledge
Reason: Various symbol can be used in Flowchart.
90 Assertion: Decision box can be used to check condition. Knowledge
Reason: False condition can not be checked.

Assertion: for loop in Python makes the loop easy to Knowledge and
calculate factorial of a number application of for loop

Reason: while loop is an indefinite iteration that is


used when a loop repeats unknown number of times and
end when some condition is met.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.

(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.

(C) Assertion is true, reason is false.

(D) Assertion is false, reason is true.


91 Assertion: nested loop is possible only in for loop Knowledge and
application of nested
Reason: nesting in while loop is allowed in Python for loop
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.

(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.

(C) Assertion is true, reason is false.

(D) Assertion is false, reason is true.

92 Assertion: range(0,5) will produce list as [0,1,2,3,4] Knowledge and


application of range()
Reason: These are the numbers in arithmetic
progression(a.p.) that begins with lower limit 0 and
goes up till upper limit -1

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.

(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.

(C) Assertion is true, reason is false.

(D) Assertion is false, reason is true.

93 Assertion: break statement terminates the loop. Knowledge and


application of break
Reason: The else clause of a Python loop executes statement
when the loop continues normally.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.

(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.

(D) Assertion is false, reason is true.

94 Assertion: break statement appears in a nested loop. Knowledge and


application of break
Reason: If the break statement is inside the inner loop statement
then it will not terminate the inner loop then it will
terminate the outer loop only

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.

(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.

(C) Assertion is true, reason is false.

(D) Assertion is false, reason is true.


95 Assertion :Python provides two looping constructs for Understanding
and while.
The for is a counting loop and while is a
conditional loop.
Reason : The while is a conditional loop as we check
the condition
first,if it is satisfied then only we can get inside
the while.
In case of for it depends upon the counting
statement of index.
a) Assertion is true and reason is false.
b) Both assertion and reason are false.
c) Both assertion and reason are true and reason is
the correct explanation of assertion.

d) Assertion is false but reason is true.


96 Assertion : To print the sum of following series Understanding
1 + 3 + 5…….n
Ravi used the range function in for loop as
follows :
range(1,n+1,2) # 3 parameters
Reason: In range function first parameter is start
value,second
parameter is stop value & the third parameter is
step value.
a) Both assertion and reason are true.
b) Both assertion and reason are false.
c) Assertion is false but reason is true
d) Assertion is true but reason is false

97 Assertion :The range() function of python which is used Understanding


in for ,
generates a list which is a special sequence
type.
Reason: A sequence in python is a sucession of values
bound
together by a single name.
a) Both assertion and reason are true.
b) Both assertion and reason are false.
c) Assertion is false but reason is true
d) Assertion is true but reason is false

98 Assertion : The else clause of python loops gets Understanding


executed when the
Loop is terminating normally- after the last
statement of
Sequence in for loop and when the test
condition
becomes false in while loop.
Reason: We can’t use else in python looping statement.
a) Both assertion and reason are true.
b) Both assertion and reason are false.
c) Assertion is true but reason is false
d) Assertion is false but reason is true
e)

99 Assertion : To print the sum of following series Understanding


12 + 42 + 72…….n2
Ravi used the range function in for loop as
follows :
range(1,n+1,3) # 3 parameters
Reason: In range function first parameter is start
value,second
parameter is stop value & the third parameter is
step value.
a) Both assertion and reason are true.
b) Both assertion and reason are false.
c) Assertion is false but reason is true
d) Assertion is true but reason is false

100 x=0 Understanding


for i in range(3,9,3):
x = x * 10 + i
print(x)
Assertion: The output of the above code will be 9.
Reason: The loop will run for 2 times.
(A) Both Assertion and reason are true and reason is
the correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

101 while 3 >=2 : Evaluation


pass
Assertion: The above while loop will run infinitely.
Reason: A while loop in Python iterates till its condition
becomes False.
(A) Both Assertion and reason are true and reason is
the correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

102 for i in range(1, 6): Understanding


for j in range(1, i):
print(“*”, end=“ ”)
print()
Assertion: In a nested loop, the inner loop must terminate
before the outer loop.
Reason: The above program will throw an error.
(A) Both Assertion and reason are true and reason is the
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

103 Assertion: range() function yields a sequence of Knowledge


numbers.
Reason: range(n) creates a sequence of numbers from 0
to n-1.
(A) Both Assertion and reason are true and reason is the
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

104 Assertion: break statement terminates the loop it lies Analysis


within.
Reason: continue statement forces the next iteration of
the loop to take place, skipping any code in between.
(A) Both Assertion and reason are true and reason is the
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

105 (A) Assertion : b = "Hello, World!" print(b[:5]) will give


output “Hello” Application
(R) Reason : This will give get the characters
from start position(5 not included)

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 true but R is not correct explanation of A

106 (A) Assertion : Application


a = "Hello" b = "llo"
c = a - b print(c)
This will lead to output He
(R) Reason : Python string does not support - operator

A. A is true but R is false


B. A is true but R is not correct explanation of A
C. A and B both are false
D. A is false and R true
107 (A) Assertion : You will get an error if you use double Application
quotes inside a string that is surrounded by double
quotes: txt = "We are the so-called "Vikings" from the
north."
(R) Reason : To fix this problem, use the
escape character \":

A. A is true but R is false

B. A is true but R is not correct


explanation of A
C. A and B both are false

D. A is True and R is correct explanation of A


108 (A) Assertion str1=”Hello” and str1=”World” then Application
print(str1*3) will give error
(R) Reason : * replicates the string
hence correct output will be
HelloHelloHello

A. A is true but R is false

B. A is true but R is not correct


explanation of A
C. A and B both are false
D. A is false and R is correct
109 (A) Assertion str1=”Hello” and str1=”World” then Application
print(‘wo’ not in str) will print false
(R) Reason : not in returns true if a particular
substring is not present in the specified string.

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 true but R is not correct
explanation of A
110 Assertion: The following command >>>“U123”.upper() Understanding
will return False.
Reason: All cased characters in the string are uppercase
and requires that there be at least one cased character.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
111 Assertion: Strings are immutable in python. Understanding
Reason: We cannot change the value of a string in place.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
112 Assertion: Function isalnum() is used to check whether Understanding
characters in the string are alphabets or numbers.
Reason: Function isalnum() returns false if it either
contains alphabets or numbers

(A) Both Assertion and reason are true and reason


is correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
113 Assertion: The indexes of a string in python is both Applying
forward and backward.
Reason: Forward index is from 0 to (length-1) and
backward index is from -1 to (-length)

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
114 Assertion: The title() function in python is used to Understanding
convert the first character in each word to Uppercase and
remaining characters to Lowercase in the string and
returns an updated string.
Reason: Strings are immutable in python.

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
115 Assertion:function helps in breaking large problem into
smaller units.
Reason: Related functions can be collected in a module
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
116 Assertion: default arguments are placed at last when
defining function headers.
Reason: It ensures that previous parameters are given
value before default parameter
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true
117 Assertion : A function may be defined without return
statement.
Reason: A function can not have multiple return values
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
118 Assertion:Formal parameters are defined while calling the
function.
Reason: Actual parameters are passed while calling the
function
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true
119 Assertion: A function may call itself.
Reason: A function calling itself is called recursive
function.
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
120 S1: Operator + concatenates one list to the end of another Understanding
list.
S2: Operator * is to multiply the elements inside the list.
Which option is correct?
A. S1 is correct, S2 is incorrect
B. S1 is incorrect, S2 is incorrect
C. S1 is incorrect, S2 is incorrect
D. S1 is incorrect, S2 is correct
121 Given list1 = [34,66,12,89,28,99] Understanding
Statement 1: list1.reverse()
Statement 2: list1[::-1]

Which statement modifies the contents of original


list1.
A. Statement 1
B. Statement 2
C. Both Statement 1 and 2.
D. none of the mentioned
122 which command we use cane use To remove Understanding
string “hello” from list1, Given, list1=[“hello”]

A. list1.remove(“hello”)
B. list1.pop(list1.index('hello'))
C. both A and B
D. none of these
123 Q6. Which of the following command(s) will Understanding
create a list?

A. list1 = list()
B. list1 = []
C. list1 = list([1, 2, 3])
D. all of these

124 S1: Operator + concatenates one list to the end of another Understanding
list.
S2: Operator * is to multiply the elements inside the list.
Which option is correct?
A. S1 is correct, S2 is incorrect
B. S1 is incorrect, S2 is incorrect
C. S1 is incorrect, S2 is incorrect
D. S1 is incorrect, S2 is correct

Sl.No. Question 1 Learning Objective


1
125 Assertion : list is mutable data Type ……………………
Reason: We can insert and delete as many elements from Remembring and
list understanding
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
Sl.No. Question 2 Learning Objective
2
126 . Assertion : list() is used to convert string in to list Remembring and
element understanding
Reason: string will be passed into list() it will be
converted into list elements
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is
not the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

Sl.No. Question 3 Learning Objective


3
127 .. Assertion : reverse() is used to reverse the list Analysing Evaluating
elements and creating
Reason: it can reverse immutable data type
elements also
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is
not the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

Sl.No. Question 4 Learning Objective


4
128 Assertion : pop() can delete elements from the last Applying
index of list
Reason: this function can remove elements from
the last index only
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is
not the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

Sl.No. Question 5 Learning Objective


5
129 . Assertion : len() displays the list length Analysing Evaluating
Reason: it is applicable for both mutable and and creating
immutable data type
(A) Both Assertion and reason are true and reason is
correct explanation of assertion.
(B) Assertion and reason both are true but reason is
not the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

130 Statement: Meenakshi wants to sort the list having name


of students of her class in descending order using sorted()
function
Reasoning: sorted() function will sort the list in ascending
order
a. Statement is True and Reasoning is False
b. Statement is False and Reasoning is True
c. Both Statement and Reasoning are True
d. Both Statement and Reasoning are False

131 Statement: Aman is working on a list of numbers .He wants to


print the list values using traversing method. He insists that
list can be traversed in forward direction and backward
direction
i.e. from beginning to last and last to beginning
Reasoning: List can be traversed from first element to
last element only.
a. Statement is True and Reasoning is False
b. Statement is False and Reasoning is True
c. Both Statement and Reasoning are True
d. Both Statement and Reasoning are False
132 Statement: Amisha wants to delete the elements from the list
using pop () function.
Reasoning: Her friend Pari suggested her to use del () function
to delete more than one elements from the list.
a. Statement is True and Reasoning is False
b. Statement is False and Reasoning is True
c. Both Statement and Reasoning are True

d. Both Statement and Reasoning are False


133 Statement: Students in the Lab practical were asked to store
the elements in a List data type in which we can perform all
the operations like addition , deletion , deletion , traversal
Reasoning: List is mutable data type.
a. Statement is True and Reasoning is False
b. Statement is False and Reasoning is True
c. Both Statement and Reasoning are True
d. Both Statement and Reasoning are False

134 Statement: A list can store a list within.


Reasoning: It is known as Nested or 2- Dimensional list.
a. Statement is True and Reasoning is False
b. Statement is False and Reasoning is True
c. Both Statement and Reasoning are True
d. Both Statement and Reasoning are False

135 Consider the following statements in Python and the Knowledge


question that follows: Understanding
i. Tuple is an ordered list
ii. Tuple is a mutable data type

From the above statements we can say that


a. Only (i) is correct
b. Only (ii) is correct
c. Both (i) and (ii) are correct
d. None of (i) and (ii) are correct

136 Assertion: A tuple cannot be sorted inline in python Knowledge


and therefore sorted () returns a sorted list after sorting Understanding
a tuple.
Reason: Tuples are non-mutable data type
(A) Both assertion and reason are true and reason is
correct explanation of assertion
(B) Both assertion and reason are true and reason is
incorrect explanation of assertion
(C) Assertion is true, reason is false
(D) Assertion is true reason, reason is true

137 >>> tuple1 = (10,20,30,40,50) Knowledge


>> tuple1.index(90) Understanding
Assertion: Above statements gives ValueError in python
Reason: ValueError: tuple.index(x): x not in tuple
(A) Both assertion and reason are true and reason is
correct explanation of assertion
(B) Both assertion and reason are true and reason is
incorrect explanation of assertion
(C) Assertion is true, reason is false
(D) Assertion is true reason, reason is true

138 T1 = (10, 20, (x, y), 30) Knowledge


print(T1.index(x)) Understanding
Assertion: Above program code displays the index of the
element ‘x’
Reason: Returns the index of the first occurrence of the
element in the given tuple
(A) Both assertion and reason are true and reason is
correct explanation of assertion
(B) Both assertion and reason are false and reason is
incorrect explanation of assertion
(C) Assertion is true, reason is false
(D) Assertion is true, reason is true

139 >>>tuple1 = (10,20,30,40,50,60,70,80) Knowledge


>>>tuple1[2:] Understanding
Output: (30, 40, 50, 60, 70, 80)
Assertion: Output given is incorrect
Reason: Slicing in above case ends at last index
(A) Both assertion and reason are true and reason is
correct explanation of assertion
(B) Both assertion and reason are true and reason is
incomplete explanation of assertion
(C) Assertion is true, reason is false
(D) Assertion is true, reason is true
140 Assertion: Remembering and
t=(10,20,30) Understanding
t[1]=45
the above mentioned question will throws an error.
Reasoning: Tuple are used to store sequential data in a
program

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
141 Assertion: Tuples are similar to string in certain feature. Analysing, Evaluating
Reasoning: Both tuple and string are immutable and Creating

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

142 Assertion: Forming a tuple from individual values is Analysing, Evaluating


called packing and Creating
Reasoning: Many individual data can be packed by
assigning them to one single variable, where data is
separated by comma

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

143 Assertion: Tuple is an in inbuilt data structure Remembering and


Reasoning: Tuple data structure is created by the Understanding
programmers and not by the creator of the python

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
144 Assertion: Tuples are ordered analysing, Evaluating
Reasoning: Items in a tuple has an defined order that will and Creating:
not be changed

(A) Both Assertion and reason are true and reason is


correct explanation of assertion.
(B) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
145 Assertion: Key of dictionary can’t be changed. Knowledge
Reason: Dictionary Key’s are immutable. Understanding
(a) Both Assertion and reason are true and reason is Analysis
correct explanation of assertion.
(b) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(c) Assertion is true, reason is false.
(d) Assertion is false, reason is true.
146 Assertion: Key of dictionary must be single element. Knowledge
Reason: Key of dictionary is always string type. Understanding
(a) Both Assertion and reason are true and reason is Analysis
correct explanation of assertion.
(b) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(c) Assertion is true, reason is false.
(d) Assertion is false, reason is true.
147 Assertion: Dictionary and set both are same because both Knowledge
enclosed in { }. Understanding
Reason: Dictionary is used to store the data in a key-value pair Analysis
format.
(a) Both Assertion and reason are true and reason is correct
explanation of assertion.
(b) Assertion and reason both are true but reason is not the
correct explanation of assertion.
(c) Assertion is true, reason is false.
(d) Assertion is false, reason is true.

148 Assertion: The pop() method accepts the key as an Knowledge


argument and remove the associated value Understanding
Reason: pop() only work with list because it is mutable. Analysis
(a) Both Assertion and reason are true and reason is
correct explanation of assertion.
(b) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(c) Assertion is true, reason is false.
(d) Assertion is false, reason is true.
149 Assertion: The items of the dictionary can be deleted by Knowledge
using the del keyword. Understanding
Reason: del is predefined keyword in python. Analysis
(a) Both Assertion and reason are true and reason is
correct explanation of assertion.
(b) Assertion and reason both are true but reason is not
the correct explanation of assertion.
(c) Assertion is true, reason is false.
(d) Assertion is false, reason is true.
150 Read the statements: Analysis

Statement (A) : A function can perform certain


functionality

Statement (B) : A function must return a result value

a) Statement A is correct

b) Statement B is correct
c) Statement A is correct but Statement B is
not correct

d) Both are incorrect

ANSWER

Question No Answer
1 A
2 A
3 B
4 A
5 C
6 Answer:- A
7 Answer:- C
8 Answer:- B
9 Answer:- B
10 Answer:- D
11 Both Assertion and reason are true and reason is correct
explanation of assertion.
12 Both Assertion and reason are true and reason is correct
explanation of assertion.
13 Both Assertion and reason are True
14 Only Assertion is true reason is False
15 Both Assertion and reason are True
16 b

17
d

18

a
19 c
20
a
21 (A) Both A and R are true and R is the correct explanation of
assertion

22 (D) A is false, R is true.

23 (D) A is false, R is true.

24 (A) Both A and R are true and R is the correct explanation of


assertion

25 (C) A is true, R is false

26 (a)
27 (c)

28 (d)

29 (a)
30 (c)
31 A
32 C
33 A
34 D
35 A
(C)
Explanation : Data types are used to identify the type of data and
associated operations to handle it. Python has five standards data
types as number, Sequences, sets, None and Mapping

Q36

(A)

Q37 Explanation : String is example of sequence datatype.


(B)
Explanation: Both are correct statement but not the explanation of

Q38 assertion statement


(D)
Explanation: Variables whose values can be changed after they
are created and assigned are called mutable. 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

Q39 name in memory.


(A)
Explanation: List is mutable datatype which means they can be

Q40 changes after creation.


Q41 C
Q42 B
Q43 C
Q44 C
Q45 C
Q46 A
C
Q47
Q48 A
A
Q49
Q50 D
(C) Assertion is true, reason is false.
Q51
(B) Assertion and reason both are false
Q52
(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
Q53

(A) Both Assertion and reason are true and reason is correct
Q54 explanation of assertion
Q55 (D) Assertion is false, reason is true.
(A) Both Assertion and reason are true and reason is correct
Q56 explanation of assertion.
(B) Assertion and reason both are true but reason is not the
Q57 correct explanation of assertion.
(A) Both Assertion and reason are true and reason is correct
Q58 explanation of assertion.
(A) Both Assertion and reason are true and reason is correct
Q59 explanation of assertion.
Q60 (D) Assertion is false, reason is true.
(B) Assertion and reason both are true but reason is not the correct
Q61 explanation of assertion.
(B) Assertion and reason both are true but reason is not the
Q62 correct explanation of assertion.
(A) Both Assertion and reason are true and reason is correct
Q63 explanation of assertion.
(A) Both Assertion and reason are true and reason is correct
Q64 explanation of assertion.
(A) Both Assertion and reason are true and reason is correct
Q65 explanation of assertion.
Q66 a
Q67 b
Q68 d
Q69 a
Q70 a
Q71 (D) Assertion is false, reason is true.
Q72 (C) Assertion is true, reason is false.
Q73 (D) Assertion is false, reason is true.
Q74 (C) Assertion is true, reason is false
(B) Assertion and reason both are true but reason is not the correct
Q75 explanation of assertion.
Q76 (B)

Q77 (A)

Q78 (A)

Q79 (C)

Q80 (D)

(A) Both Assertion and reason are true and reason is correct
Q81 explanation of assertion.
(A) Both Assertion and reason are true and reason is correct
Q82 explanation of assertion.
Q83 (C) Assertion is true, reason is false.
(A) Both Assertion and reason are true and reason is correct
Q84 explanation of assertion.
(A) Both Assertion and reason are true and reason is correct
Q85 explanation of assertion.
Q86 (A)
Q87 (B)
Q88 (D)
Q89 (A)
Q90 (C)
Q91 A
Q92 A
Q93 C
Q94 D
Q95 C
Q96 C
Q97 A
Q98 A
Q99 C
Q100 A

(D) Assertion is false, reason is true.


Q101

(A) Both Assertion and reason are true and reason is the correct
explanation of assertion.
Q102

(C) Assertion is true, reason is false.


Q103

(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
Q104

(B) Assertion and reason both are true but reason is not the correct
explanation of assertion
Q105

Q106 B
Q107 D
Q108 D
Q109 D
Q110 B
Q111 (D)
Q112 (A)

Q113 (C)

Q114 (A)

Q115 (D)
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
Q116
Both Assertion and reason are true and reason is correct
Q117 explanation of assertion.
Q118 (C) Assertion is true, reason is false.
Q119 Assertion is false, reason is true.
(A) Both Assertion and reason are true and reason is correct
Q120 explanation of assertion.
Q121 C. Both Statement 1 and 2 are correct
Q122 A. S1 is correct, S2 is incorrect
Q123 C. Both Statement 1 and 2.
Q124 C. both A and B
Q125 D. all of these
Q126 (A)
Q127 (A)
Q128 (C)
Q129 (A)
Q130 (A)
Q131 b
Q132 a
Q133 b
Q134 c
Q135 c

Q136 C.Both (i) and (ii) are correct


(A) Both assertion and reason are true and reason is correct

Q137 explanation of assertion


(A) Both assertion and reason are true and reason is correct

Q138 explanation of assertion


(B) Both assertion and reason are false and reason is incorrect

Q139 explanation of assertion


(B) Both assertion and reason are true and reason is incomplete

Q140 explanation of assertion


Q141 B
Q142 A
Q143 A
Q144 C
Q145 A
Q146 a
Q147 c
Q148 d
Q149 c
Q150 a
Q151 c. Statement A is correct but Statement B is not correct

Name of the vetter- KAMAL KANT

GUPTA Name of the KV- NO 2

KANCHRAPARA Region- KOLKATA

Mobile No- 9493887480

E-mail ID - kamalkant.kv@gmail.com
Name of the Chapter- PYTHON REVISION TOUR

CBQ NO Question Content Learning Objective(if


Provided)
1 Python is portable and platform
independent, means it can run on various
operating systems and hardware platforms.
Python has a rich library of predefined
functions. Python is also helpful in web
development. Many
popular web services and applications are built
using Python.
a Python can run on which platform, if code has Application
written on windows7
A. Macintosh
B. Windows
C. Linux
D. All of the above
b Which of the following is an example of Application
predefined function
A. print()
B. show()
C. display()
D. screen()
2 Read the passage given below and answer the following Learning Objective
questions.
(i) This is My school
(ii) This is My\ school
a Write statement to Display line (i) Application
b Write statement to Display line (ii) Application
3 Shakila wants to Give Message to their Students in the Understanding
First Class Of Python as
“Good Morning”
“Welcome to First class of python”
Now help to Shakila for Accuracy Result.
>>>print(----------------)
-------------------Line-1
>>>........................(“Welcome to First class of python”)
------------Line2
>>>print(Bye!)-------------Line3

a) i. Choose the correct option in Line-1 if the result to Evaluation


be Good Morning:
a. “Good Morning”
b. “Good Morning
c. “GoodMorning”
d. None of the above

b) ii. Choose the correct option in Line-2 :


a. Print
b. print
c. printf
d. None of the above

c) iii. What should be the result after executing Line-3: Evaluation


a. Bye
b. “Bye!”
c. Bye!
d. Error

d) iv. Shakila wants to get the output as: Analysis


Good Morning
Welcome to First class of python
Which lines to be execute:
a. Line-2 and Line-3
b. Line-1 and Line-2
c. Line-1,Line-2 and Line-3
d. Line-1 and Line-3

4 Nilesh this program by using python, he faced some Evaluation


problems while executing the given code. Based on
this code find out the answers of the following
questions print(“Hello Nathan”,”Hello Lalit”)
-----------------------------------------------------Line1
greet1=“Hello Nathan”
greet2=”Hello Lalit”
name1=”Nathan”
name2=”Lalit”
print(----------,----------)------------------Line2
print(“Hello”,------------,”,”,------------)-----------------Line3
printf(“Have a Nice Day !”)-------------------Line4
a) i. Choose the correct option in Line-2 if the output is Hello
Nathan Hello Lalit
a. ‘greet1’,’greet2’
b. “greet1”,”greet2”
c. greet1,greet2
d. ‘Hello Nathan, Hello Lalit’
b) ii. Choose the correct option in Line-3 Analysis
if the output is Hello Nathan,Lalit
a. name1,name2
b. Nathan, Lalit
c. ‘name1’,’name2’
d. “name1”,”name2”
c) iii. If Nilesh write Print instead of print in Line1 , Understanding
what features of Python it indicates:
a. Cross-platform
b. case sensitive
c. Portability
d. None of these
d) iv. In which Line Nilesh will face problem: Analysis
a. Line1
b. Line2
c. Line3
d. Line4
Rakesh has written following three statements in python. ……..
5 Help him to identify different type of tokens. Understanding
>>> x = 10 # Statement 1
>>> y = 20 # Statement 2
>>> z = x > y or y != 20 # Statement 3

(i) in Statement 3 ‘or’ is which type of token


a. Operator
b. Keyword
c. Identifier
d. Litrals

(ii) in Statement 3 ‘z’ is which type of token


a. Operator
b. Keyword
c. Identifier
d. Litrals

(iii) in Statement 3, 20 is which type of token


a. Operator
b. Keyword
c. Identifier
d. Litrals

(iv) What output type(z) will give


a. <class 'int'>
b. <class 'float'>
c. <class 'str'>
d. <class 'bool'>
6 Ramesh has installed Python 3.6 in his computer. He is Knowledge
now working with Python IDLE. Which of the following
is provided with IDLE

a. Code Editor
b. Code Interpreter
c. Debugger
d. All of the above
import_______________#1
7
num=int(input(“Enter a number: ”)) #2
sroot=math.sqrt(num) #3 Understand, Apply,
print(“Square root is…: ”, sroot) #4 Evaluate, Create

(A) Which module should be imported at line 1?


(i) math
(ii) random
(iii) pickle
(iv) csv
(B) What will be the output if the input given is 64?
(i) 16.0
(ii) 8.0
(iii) 24.0
(iv) Error

8 import_______________#1
print(random.randint(0,9)

(A) Which module should be imported at line 1?


(i) math Understand, Apply,
(ii) random Evaluate, Create
(iii) pickle
(iv) csv
(B) What is the maximum value that can be printed?
(i) 0
(ii) 1
(iii) 9
(iv) 10

9 Schools use “Student Management Information System”


(SMIS) to manage student-related data. This system
provides facilities for :
● recording and maintaining personal details of
students.
● maintaining marks scored in assessments and
computing results of students.
● keeping track of student attendance.
● managing many other student-related data.
Identify the correct data type to be used in the above
program for following data values :
Data Values
1) Name of the School
2) Student Name
3) Admission Number
4) Class
5) Section
6) Roll Number
7) Address
8) Pincode
9) Mobile Number
Data Types
I. Integer
II. Floating Point
III. Boolean
.String
a) I → 3, 6, 8, 9 IV → 1, 2, 4, 5, 7
b) I → 3, 4, 5, 6, 8, 9 IV → 1, 2, 7
c) II → 3, 6, 8, 9 III → 1, 2, 4, 5, 7
d) III → 3, 6, 8, 9 IV → 1, 2, 4, 5, 7

10 Hemlata has written the following code : Subject


= ['Maths', 'Eng', 'Phy', 'Chem', 'CS']
MaxMarks = (90, 90, 70, 70, 60)
Subject[-1] = 'Computer Science' print(Subject)
MaxMarks[-1] = 70
print(MaxMarks)

Choose the correct statement based on the above case :


a) It will display the output only for print(Subject)
as Subject is a list.
b) It will display the output only for
print(MaxMarks) as MaxMarks is a tuple.
c) It will display both the outputs.
d) It will not display any output

11 Read the passage given below and answer the following Learning Objective
questions.
Rohini wants to calculate the average marks of n
students. She writes the code that is mentioned below.
Fill in the missing blanks so that the code gives the
desired output

#Function to calculate average marks of n students


def computeAverage(list1,n):
#initialize total
total = 0
for marks in : #---------------statement 1
total = total + marks
average = total n #----------------Statement 2
return average

#create an empty list


list1 = []
print("How many students marks you want to enter: ")

n= (input()) #-------------------------------Statement
3
for i in range(0,n):
print("Enter marks of student",(i+1),":")
marks = int(input())
#append marks in the list
list1. (marks)
#--------------------------Statement 4
average = computeAverage(list1,n)
print("Average marks of",n,"students
is:",average)
i) Which of the following should be used to fill the blank Creation
in Statement 1
a) total
b) marks
c)list1
d)average
ii)Which of the following operators should be used to Creation
calculate the average in Statement 2
a) +
b) /
c) %
d) *
iii) Which of the following datatype should be used for Creation
typecasting the input in statement 3
a) string
b)int
c)list
d)tuple
iv) Which of the following functions must be used to Creation
insert a single value at the end of the list in statement 4
a) append()
b)extend()
c)insert
d)put()
12 Amit is trying to figure out the datatype of the variables
he used in his code that checks whether a number is
prime or not. The code is given below:

num = int(input("Enter the number to be checked: "))


print(type(num)) #---------------------------STATEMENT
1
flag = 0
print(type(flag))
#----------------------------STATEMENT 2
msg1="is not a prime number"
msg2="is a prime number"
print(type(msg2))
#-----------------------------STATEMENT 3

if num > 1 :
print(type(num>1))
#-----------------------------STATEMENT 4
for i in range(2, int(num / 2)):
if (num % i == 0):
flag = 1 #num is a not prime number
break #no need to check any further #presume
num is a prime number
if flag == 1:
print(num , msg1)
else:
print(num , msg2 )
i) What will be the output of STATEMENT 1 : Analysis
a) <class 'int'>
b) <class 'float'>
c) <class 'str'>
d) <class 'bool'>

ii) What will be the output of STATEMENT 2 : Analysis


a) <class 'int'>
b) <class 'float'>
c) <class 'str'>
d) <class 'bool'>
Iii) What will be the output of STATEMENT 3 : Analysis
a) <class 'int'>
b) <class 'float'>
c) <class 'str'>
d) <class 'bool'>
iv) What will be the output of STATEMENT 4 : Analysis
a) <class 'int'>
b) <class 'float'>
c) <class 'str'>
d) <class 'bool'>
13 Anushka is the class monitor of class XII. To help Application
teachers and to maintain the records of all her classmates,
she wants to keep the following data in python language:
-
1. To store the names of classmates of her class,
then it is easy to update when some new students
join, or some leave the course.
2. To store mobile phone book to store
phone numbers of all the classmates
3. To store the list of types of equipment present
in her class.
4. To store the names of months in a year.
Anushka is feeling difficulty in choosing the
correct datatype to store these values. Help her by
giving answers following questions:
14 Aryan want to check whether his friends are resident of Understanding and
Delhi or Not. Suggest him which data type he can used to Applying
represent the above data values and why?
15 Ravi wants to find calculate area of Triangle by python
code .the sides of the triangle are a, b,c and values
are a=5, b=6,c=7.
So he will use arithmetical operators to check equality of
mathematical expression
a) a+b>c
b)a-b<c
i) How he will find the area of the
Triangle?
ii) can he use use Type casting method ?
iii) can he will use input() method ?
iv) can he wil use import math function ?
16 Neha written the code to find the output of If
a=8 , b=7, c=1, d=0
print(a> b>c)-------- (i)
print(a<b or b>c)------ (ii)
print(not(a>b))-----------
(iii)
print(a*b-c*d==a<b)----------(iv)
a) What she will get in i line
b)what she will get in ii line
c)what she will get in iii line
d) what she will get in iv line

17 Kritika is new to python and has written following code for


simulating action of an arithmetic calculator but is having
problem in writing few of the operators and expression
marked in the program as statement 1 to statement 5 . Choose
correct options for each of the statements:

n1= int(input("enter first number"))


n2= int(input("enter second number"))
op= input("enter valid arithmetic operator : ")

if op=='+':
result= n1+n2
elif op=='-':
result=n1-n2
elif op=='*':
result=n1*n2
elif op==' ': # Statement 1i: operator to raise n1 to
the power n2
result = n1 n2 # Statement 1ii: operator to raise n1 to the
power n2
elif op==' ': # Statement 2i: operator to find floor
division
result=n1 n2 # Statement 2ii: operator to find floor
division

elif op==' ': # Statement 3i: operator to find


remainder
result=n1 n2 # Statement 3ii: operator to find
remainder
elif op=='/':

if n2 : #Statement 4 : Expression to avoid divide by


zero error
result= n1 n2 # statement 5 : operator to get quotient
else:
result="divide by zero error"
else:
print("invalid operator")

print("operation ",op,"on",n1,"and ",n2 , "is ", result)


1 Choose appropriate operator from below to be written in Creation
empty space for statement 1i and 1ii
A) **
B) %
C) /
D)//
2 Choose appropriate operator from below to be written in Creation
empty space for statement 2i and 2ii
A) **
B) %
C) /
D)//
3 Choose appropriate operator from below to be written in Creation
empty space for statement 3i and 3ii
A) **
B) %
C) /
D)//
4 Choose appropriate expression from below to be written in Creation
empty space for statement 4
A) n2>0
B) n2>=0
C) n2==0
D) n2 is 0
5 Choose appropriate operator from below to be written in Creation
empty space for statement 5
A) **
B) %
C) /
D)//
18. Mridul wants to obtain different outputs in the following Evaluation
expression:
A= 45 <operator> 8
i. What should he write in place of operator to obtain
integer as an output?
(A) /
(B) //
(C) %
(D) Any of the above
ii. What should he write in place of operator to obtain
float as an output?
(A) /
(B) //
(C) %
(D) Any of the above
iii. What should he write in place of operator to obtain the
remainder as an output?
(A) /
(B) //
(C) %
(D) Any of the above

19 Karan wants to add 2 no.s and print the result. He has Creation
written the following code. As a programmer, help him
write the correct code:
X=input(“Enter the first number”) ) #S1
Y= int(input(“Enter the second number”)) #S2
Z=X+Y # S3
print(z) # S4

i. Karan is not getting the desired output. What is the


correction required?
(A) S1 should be int(input(Enter the first number))
(B) S2 should be input(“Enter the second number”)
(C) S4 should be print(int(z))
(D) Both A and B

Ii . What is the datatype of X in the above code?


(A) int
(B) str
(C) bool
(D) float
20 Raman is working on a python project – in one of the Analysis
modules he has written the following code which is not
executing properly
x = int(input("Enter the salary of July:"))
y = int(input("Enter the salary of December:"))
if y > = x:
percent = (y-x) * 100 //x
print("Salary Incremented by = ",y-x)
print("Percentage of Salary incremented=",percent)
else:
print("Salary not incremented.")
(i) The interpreter shows the error at if statement. What is
it ?
(ii) When the Raman has corrected the error at if, the
program shows another error – “Expected an indented
block.” Why ?
(iii) The increment percentage in salary is not calculated
correctly in the following run –
Enter the salary of July:12645
Enter the salary of December:13258
Salary Incremented by = 613
Percentage of Salary incremented= 4
Write the correct expression for percent variable.
(iv) What would be the type of percent variable.
21 Sagar is writing a program to calculate the area of a Analysis
triangle using heron’s formula. He wrote his program like
this -
import math
a = input("Enter first side:")
b = input("Enter second side:")
c = input("Enter third side:")
area = math.sqrt(s(s-a)(s-b)(s-c))
print("Area of triangle = ",area)
(i) What is the required correction in the three input
statements.
(ii) The expression -
s = a+b+c / 2.0
is syntactically correct but logically incorrect. Write
the correct expression.

(iii) The program shows the error in the expression -


area = math.sqrt(s(s-a)(s-b)(s-c)). Write the
correct
expression for it.
(iv) Write the module to be imported to
successfully execute sqrt().
22 Raman is working on a python project – in one of the Analysis
modules he has written the following code which is not
executing properly
x = int(input("Enter the salary of July:"))
y = int(input("Enter the salary of December:"))
if y > = x:
percent = (y-x) * 100 //x
print("Salary Incremented by = ",y-x)
print("Percentage of Salary incremented=",percent)
else:
print("Salary not incremented.")
(i) The interpreter shows the error at if statement. What is
it ?
(ii) When the Raman has corrected the error at if, the
program shows another error – “Expected an indented
block.” Why ?
(iii) The increment percentage in salary is not calculated
correctly in the following run –
Enter the salary of July:12645
Enter the salary of December:13258
Salary Incremented by = 613
Percentage of Salary incremented= 4
Write the correct expression for percent variable.
(iv) What would be the type of percent variable.
23 Sagar is writing a program to calculate the area of a Analysis
triangle using heron’s formula. He wrote his program like
this -
import math
a = input("Enter first side:")
b = input("Enter second side:")
c = input("Enter third side:")
area = math.sqrt(s(s-a)(s-b)(s-c))
print("Area of triangle = ",area)
(i) What is the required correction in the three input
statements.
(ii) The expression -
s = a+b+c / 2.0
is syntactically correct but logically incorrect. Write
the correct expression.

(iii) The program shows the error in the expression -


area = math.sqrt(s(s-a)(s-b)(s-c)). Write the
correct
expression for it.
(iv) Write the module to be imported to
successfully execute sqrt().
24 X = int(input(“Enter value of x:”) #Statement 1
Y = int(input(“Enter value of y:”))
if X > Y #Statement 2
print(“x is greater”) #Statement 3
else:
print(“Y is greater”) #Statement 4

#Answer the following question on the basis of the obove


program.
a Which type of Error will be raised in Statement 1? Evaluation
a) SyntazError
b) TypeError
c) ZeroDivisionError
d) NameError
b Which type of Error will be raised in Statement 2? Evaluation
a) IndexError
b) IndentationError
c) SyntaxError
d) NameError
c Which type of Error will be raised in Statement 3? Evaluation
a) NameError
b) IndentationError
c) ZeroDivisionError
d) TypeError
d Which type of Error will be raised in Statement 3? Evaluation
a) NameError
b) IndentationError
c) ZeroDivisionError
d) TypeError
25 def Fact(x):
fact = 1
for i in range(x,1,-1):
fact =* I
#Statement 1
return factorial
#Statement 2

a = int(input(“Enter the number to find factorial:”))


f = Fact()
#Statement 3
print(“Factorial of the number is”f)
#Statement 4

#Answer the following question on the basis of the obove


program.
a Which type of Error will be raised in Statement 1? Evaluation

a) SyntazError
b) TypeError
c) ZeroDivisionErro
d) NameError
b Which type of Error will be raised in Statement 2? Evaluation
a) IndexError
b) IndentationError
c) TypeError
d) NameError
c Which type of Error will be raised in Statement 3? Evaluation
a) NameError
b) IndentationError
c) ZeroDivisionError
d) TypeError
d Which type of Error will be raised in Statement 3? Evaluation
a) NameError
b) SyntaxError
c) ZeroDivisionError
d) TypeError
26 Ramesh is learning Python in preparation for an Application
internship exam. He is having a problem with one
question in which she has been assigned an incomplete
Python code (given below) to create a CSV file called
‘Employee.csv.’ Assist her in completing the code that
generates the CSV file with the given content.

Incomplete Code:
#Statement 1
Csvfile = open( , , newline=’’)
#Statement 2
CsvObj = csv. (_________) #Statement 3
Rows = []
Fields = [‘Empnumber’, ‘EmpName’, ‘EmpDesig’,
‘EmpSalary’]
Rows.append(Fields)
for i in range(5):
Empno = input(“Enter Employee No:”)
Name = input(“Enter Employee Name:”)
Desig = input(“Enter Designation:”)
Salary = int(input(“Enter Salary:”))
records= [________________] #Statement 4
Rows. (_______) #Statement 5
________(Rows) #Statement 6
Csvfile.close()

a. Identify the relevant module to import in the blank


space in line marked as Statement 1.
(A) import pickle (B) import txt
(C) import csv file (D) import csv
b. Identify the missing code for the blank space in line
marked as Statement 2.
(A) “Employee.txt”, ‘rb’ (B)
“Employee.csv”, ’wb’
(C) “Employee.csv”, ’w’ (D)
“Employee.dat”, ’w’
c. Choose the function name (with argument) that should
be used in the blank space of line marked as
Statement 3.
(A) writer(“Employee.csv”) (B) read(“Csvfile”)
(C) writer(CsvObj) (C) writer(Csvfile)
d. Identify the suitable code for blank space in line
marked as Statement 4.
(A) Empno, Name, Desig, Salary (B)
“Empno, Name, Desig, Salary”
(C) “Empno”, “Name”, “Desig”,”Salary” (D)
“Empno – Name- Desig – Salary”
e. Identify the suitable code for blank space in the line
marked as Statement 5.
(A) insert(data) (A)
delete(data)
(C) append(records) (D)
addrows(records
f. Identify the suitable code for blank space in the line
marked as Statement 6.
(A) Csvfile.load() (B)
CsvObj.dumprow()
(C) Records.reader() (D)
CsvObj.writerows()
27 The owners of the ‘Foodmill’ store wish to generate a Application
bill for each transaction using a binary file. In order to do
this, they have recruited a friend who is learning Python.
The friend has made a file called ‘foodmill.dat’ that
contains information like Itemno, Item Name, Qty and
Price in order to compute Total Amount, but is having
problems finishing it. Assist the friend in finishing the
code.
Incomplete Code:
import__________#Statement 1
File = ('foodmill.dat','______') #Statement 2
ch='y'
while True:
Itemno = input("Enter Item No:")
Product = input("Enter Product Name:")
Qty= int(input("Enter Quantity:"))
Price = int(input("Enter Price:"))
Amount=Qty *Price
records= [Itemno,Product,Qty,Price,Amount]
pickle________________#Statement 3
ch=input("Do you want to buy more....")
if ch=='y' or ch=='Y':
continue
else:
break
File.close()
def Total_Amount():
f= open('foodmill.dat','rb+')
total_Amt=0
try:
while True:
R=__________#Statement 4
#Statement 5
print("You have purchased",R[2],R[1],"of
price","Rs",R[3],"and amount is", R[4])
: #Statement 6
f.close()
print("Total Amount is Rs",total_Amt)
a. Identify the relevant module to import in the blank
space in line marked as Statement 1.
(A) pickle (B) bin
(C) tsv (D) csv
b. Identify the code to open the file along with the access
mode so that every time the program is run, new
customer records will be added in Statement 2.
(A) open ‘rb’ (B) open ‘wb’
(C) open ‘r’ (C) write ‘w’
c. Identify the suitable code for blank space in the line
marked as Statement 3.
(A) load(records,file) (B)
dumps(record,file)
(C) dump(records,file) (C)
load(file,records)
d. Identify the suitable code for blank space in line
marked as Statement 4.
(A) pickle.load(F) (B) pickle.dump(f)
(C) pickle.load(R) (D) pickle.load(f)
e. Identify the suitable code to calculate the total Amount
in the line marked as Statement 5.
(A) total_Amt=R[4] (B)
total_Amt=R[3]+R[4]
(C) total_Amt+=R[4] (D)
total_Amt=R[4]*2
f. Identify the suitable keyword to handle the exception
(if any) that occurs during execution of the try
clause.
(A) catch (B) except
(C) stop (D) exception
28 Raj is a trainee software programmer. He has been
assigned a task to prepare a small quiz application in
which a question is displayed on user’s screen, when Knowledge,
prompted. After that, the user submits his/her response. Understanding
The user may continue to play the quiz, as the program Application
repeatedly ask the user to enter his/ her choice to continue Analysis
with the quiz. When the user does not want to continue, Evaluation
he/she may exit. On exit, the score is getting displayed Creation
with a Thank You message.

1. Raj wants to allow the program to repeatedly ask the


user to enter their choice if they want to continue with the
quiz. Which loop option should Raj use?
a. while loop with if condition
b. while loop without if condition
c. for loop with if condition
d. for loop without if condition
2. Raj has to continuously check for a correct answer,
each time user enters a value and compute the total score.
He can do it easily by defining a condition using
a. if statement
b. if-else statement
c. if-elif statement
d. None of the above

29 # python program to illustrate If Creation / Application

statement i = 10

if (i > 15):
print("10 is less than 15")
print("I am Not in if")
find the correct output:
A) I am Not in if
B) 10 is less than 15
C) Both
D) None of them
30 # Explicit function Creation / Application
def digitSum(n):
dsum = 0
for ele in str(n):
dsum +=
int(ele)
return dsum

# Initializing list
List = [367, 111, 562, 945, 6726, 873]

# Using the function on odd elements of the


list
newList = [digitSum(i) for i in List if i & 1]

# Displaying new list


print(newList)
find the correct output:
A) [3,18,18,16
B) [16,18,18,3]
C) [16,3,18,18]
D) None of them

31 Ramesh is looking for his dream job but has some Evaluation
restrictions. He loves Delhi and would take a job there if
he is paid over Rs. 40000 a month. He hates Chennai and
demands at least Rs. 100000 to work there. In any other
location he is willing to work for Rs. 60000 a month. The
following code shows his basic strategy for evaluating a
job offer.
Source code:
pay= …………
location= ………..
if location = = “Mumbai”:
print (“I will take it!”) #Statement1
elif location = = “Chennai”:
if pay < 100000:
print (“No way”) #Statement2
else:
print (“I am willing”) #Statement3
elif location = = “Delhi” and pay > 40000:
print (“I am happy to join”) #Statement4
elif pay > 60000:
print (“I accept the offer”) #Statement5
else:
print (“No thanks, I can find something better”)
#Statement6
On the basis of the above code, choose the right statement
which will be executed when different inputs for pay and
location are given:
1.1 If input: location=”Chennai” and pay=50000
(A) Statement1
(B) Statement2
(C) Statement3
(D) Statement4
1.2 If input: location=”Surat” and pay=50000
(A) Statement2
(B) Statement3
(C) Statement4
(D) Statement6
1.3 If input: location=”Any other city” and pay=10000
(A) Statement1
(B) Statement2
(C) Statement4
(D) Statement6
1.4 If input: location=”Delhi” and pay=500000
(A) Statement6
(B) Statement5
(C) Statement4
(D) Statement3
1.5 If input: location=”Lucknow” and pay=65000
(A) Statement2
(B) Statement3
(C) Statement4
(D) Statement5
32 Consider the following code segment for the questions Evaluation
2.1 – 2.5:
a=int(input(“Enter an integer:”))
b=int(input(“Enter an integer:”))
if a< = 0:
b=b + 1
else:
a=a + 1
if a > 0 and b > 0 :
print (“W”)
elif a > 0:
print (“X”)
if b > 0:
print (“Y”)
else:
print (“Z”)
2.1 What letters will be printed if the user enters 0 for a
and 0 for b?
(A) Only W
(B) Only X
(C) Only Y
(D) W and X
2.2 What letters wull be printed if the user enters 1 for a
and 1 for b?
(A) W and X
(B) W and Y
(C) X and Y
(D) X and Z
2.3 What letters will be printed if the user enters 1 for a
and -1 for b?
(A) W and X
(B) X and Y
(C) Y and Z
(D) X and Z
2.4 What letters will be printed if the user enters 1 for a
and 0 for b?
(A) W and X
(B) X and Y
(C) Y and Z
(D) X and Z
2.5 What letters will be printed if the user enters -1 for a
and -1 for b?
(A) Only W
(B) Only X
(C) Only Z
(D) No letters are printed

33 Read the passage given below and answer the Learning Objective
following questions……..
Anamika is a new programmer started writing python
program using continue statement.

for x in range (10,20):

if (x % 5 == 0) : continue

print(x)

She wants to print the values in between 10 to


20(inclusive). Help her choosing the right range ()
statement

A. range(10,21)

B. range(10,22)

C. range(10,22-2)

D. None

34 Satyam Satyajeet has learnt python programming. Knowledge and


Help him to choose a logic for know number of application of while
iterations he will apply. loop

A. while

B. for

C. if

D. None
35 CASE A Understanding
Azriel wants to print a pyramid of stars.His friends &
Abhishek and Bhargav suggested him to use repetitive Application
control statement in the code.Finally he decides to use a
nested for loop to print the following pyramid of stars.
*
**
***

****
*****
The code which Azriel wrote is as follows:

for i in range(1,6): #statement 1


for j in range(1,i): # statement 2
print("*",end=" ")
print()
According to the CASE,answer the following
questions:
Q1 Will he get the desired output
1. Yes
2. No

Q2 In which statement he needs to make the correction


1. Statement 1
2. Statement 2

Q3 Will he get the desired output if he rewrites the


code like:
for i in range(1,7):
for j in range(1,i):
print("*",end=" ")
print()
1. Yes
2. No

Q4. The range() function of python generates a list which


is a
sequence type.
Is this statement true regarding the function
range()
1. False
2. True

36 CASE B Understanding
Arpita was asked by her Maths Teacher to make a &
program in python to find the factorial of a given Application
number.She asked her friends Vashaswati and Ritika
about factorial.Ritika explained her that factorial of a
number is the product of all integers from 1 to that
number.To which Vashaswati added that Factorial is only
defined for the positive numbers.F.E the factorial of 5 is
5*4*3*2*1=120.
Arpita finally wrote the code as follows:
num=int(int(“ENTER A NUMBER : “) #
statement 1
fact=1 #
statement 2
a=1 #
statement 3
while a<=num: #
statement 4
fact*= a #
statement 5
print(“The factorial is “,fact) #
statement 6

ARPITA IS NOT GETTING THE DESIRED OUTPUT.


According to the CASE,answer the following
questions:

Q1. What problem is she facing?


a) EOF Error
b) ZeroDivisionError
c) IndexError
d) Infinite loop

Q2. Comment number 5(statement 5) means


a) fact = fact * a
b) fact * fact = a
c) a = a * fact
d) a * a = fact

Q3. Which shoud we add to get the desired output


a) a - = 1
b) a + = 1
c) a / = 1
d) a % = 1

Q4. Where should we insert the correct code out of the


mentioned
Codes in Q3.
a) Between statement 3 and statement 4
b) Between statement 2 and statement 3
c) Between statement 5 and statement 6

d) Between statement 4 and statement 5


37 The petals in certain plants such as sunflowers, roses,
lilies and buttercups follow the Fibonacci pattern, and
these flowers are called Fibonacci flowers. Fibonacci
numbers follow a specific pattern i.e.; every number in
the sequence is the sum of two numbers preceding it in
sequence.
Example:- 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ……..

One student has found following incomplete python code


to generate first n terms of Fibonacci sequence:-

nterms = int(input("How many terms? "))


# first two terms
n1, n2 = 0, 1
count = 0
# check if the number of terms is valid
if nterms <= 0:
print("Please enter a positive integer")
# if there is only one term, return n1
elif nterms == 1:
print("Fibonacci sequence upto",nterms,":")
print(n1)
# generate fibonacci sequence
else:
print("Fibonacci sequence:")
while count < : #statement1
print(n1)
nth = n1 + n2
# update values
n1 =____________________________#statement 2
n2 =____________________________#statement 3
count += 1

i If the 18th and 20th terms in the Fibonacci sequence are Understanding
1597 and 4181 respectively, what will be the 19th term?
(A) 1597
(B) 2584
(C) 4181
(D) 5778

ii Identify the suitable code for blank space in the line Evaluation
marked as Statement-1.
(A) 0
(B) n1
(C) nterms
(D) n2

iii Identify the suitable code for blank space in the line Analysis
marked as Statement-2.
(A) n1
(B) n2
(C) nterms
(D) nth

iv Identify the suitable code for blank space in the line Application
marked as Statement-3.
(A) n1
(B) n2

(C) nterms
(D) nth
38 In Physics class, during Mirror practicals students have
observed that some numbers written on papers have the
same mirror image whereas others have different.
Example:- number 1221 has mirror image 1221 whereas
number 1231 has mirror image 1321.

After discussion with their math teachers, they have


found out that numbers with the same mirror image are
called Palindrome numbers.

Students asked their computer teacher to write python


code to check that the given number is Palindrome or not
but he has given following incomplete code:-

number=int(input("Enter any number :"))


#store a copy of this number
temp=number
#calculate reverse/mirror-image of this number
reverse_num=0
while( ):
#statement1
#extract last digit of this number
digit = number % 10
#append this digit in reversed number
reverse_num = reverse_num * + digit
#statement2
#floor divide the number leave out the last digit
from number
number = number // 10
#compare reverse to original
number if( == reverse_num ):
#statement3
print("The number is palindrome!")
else:

print("Not a palindrome!")

i Which of the following is not a Palindrome number? Understanding


(A) 12321
(B) 1234321
(C) 4181814
(D) 1233443221

ii Identify the suitable code for blank space in the line Application
marked as Statement-1.
(A) number > 0
(B) number < 0
(C) reverse_num > 0
(D) reverse_num == 0

iii Identify the suitable code for blank space in the line Analysis
marked as Statement-2.
(A) 100
(B) 10
(C) 1
(D) 0
iv Identify the suitable code for blank space in the line Evaluation
marked as Statement-3.
(A) digit
(B) number
(C) temp
(D) None of the above

39 Consider the following case and write the code for the Analysis
same

Given a string. Cut it into two "equal" parts (If


the length of the string is odd, place the center
character in the first string, so that the first
string contains one more characther than the
second). Now print a new string on a single
row with the first and second halfs
interchanged (second half first and the first half
second)
s = input()

//Fill in
the statement

A. print(s[(len(s) + 1) // 2:] +
s[:(len(s) + 1) // 2
B. print(s[(le
n(s) + 1)
// 2:]
C. (c)
s[:(le
n(s)
+ 1)
// 2

D. None of the above


40 Raju was solving a puzzle in which he wants to count Analysis
the number of spaces.
Help him to complete
the following
code
str1=input(“Ent
er the string”)
// Statement 1

A. print(str1.count(' ') + 1)
B. print(str1.count(' ') )

C. print(str1.cnt(‘’))
D. print(str1.cnt(‘’)+1

41 Savita is a student of class XII Science. Her teacher has Applying


given her task to find out the answer of following
question .

Line=input(“Enter a line”)
Lower_count=upper_count=digit_count=alphabet_count=
0
for a in line:
if : #1-function to count the lower case
character
lower_count +=1
elif : #2-function to count number of
upper case
upper_count +=1 #character in the string
elif : #3- function to count digit in the
string
digit_count += 1
elif : #4 –Function to count alphabets in
the given string
alphabet_count += 1

(i) To check whether the string is in title case or not.


(ii) To convert all upper case letter to lower case.
(iii) To check and find is there any digit
present in the given string.
(iv)To find the length of the string.

42 Mr Pawan sir has given following task to students. Help Evaluating


then in completing the task based on python string
functions and write the output:
:
(i) mystr = 'Python is famous in India'
print(mystr.partition('famous'))

(ii) oldstring = 'I like Hero Bike'


newstring = oldstring.replace('hero', 'zero')
print(newstring)

(iii) my_tuple=('3','7','2','0')
Gap="buy"
print(Gap.join(my_tuple))

(iv) mystr2="Hello thee,study tonight,all are welcome"


print(mystr2.split(','))
43 Sunil writes a list program as shown below .based on the
code answer the questions
data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] #Stmt1
def fun(m):
print(m)
#Stmt2
v = m[0][0]
print(v) #Stmt 3
for row in m:
for element in row:
if v < element:
v = element
return v

print(fun(data[0]))
#Stmt4
i The declaration of the LIST data is called Application
(i) Local (ii) Global(iii) local and global (iv) none of the
above
ii What will be printed after execution of the line #2 ? Application
(i) [1,2] (ii) [[1, 2], [3, 4]] (iii) [[5, 6], [7, 8]] (iv) [5,6]
iii What will be printed after execution of the line #3 ? Application
(i) 4 (ii) 5 (iii)2 (iv)1
iv What will be last line of the output after execution of the Application
line #4 ?
(i) 4 (ii) 5 (iii)2 (iv)1
v What will be the last line of the output of the above code, Application
if line #4 is replaced with print (fun (data (1)) ?
(i) 8 (ii) 5 (iii)2 (iv)1
44 Based on the following code answer the questions
given below
import_____________________#1
AR=[20,30,40,50,60,70]
START=random.randint(1,3)

END=random.randint(2,4)
for P in range(START, END+1):

print (AR[P],end=”#“)
i What module should be imported To execute the Application
above code #1?
(I) math (II) random (iii) pickle (iv) csv
ii What will Be the maximum value of the variables SATRT Application
and END?
(i) 3,4 (ii) 4,3 (iii) 2,4 (iv) 4,2
iii What will Be the minimum value of the variables START Application
and END?
(i) 2, 1 (ii) 1, 2 (iii) 1, 3 (iv) 1, 4
iv What possible outputs(s) are expected to be displayed on Application
screen at the time of execution of the program?
(i) 10#40#70# (ii) 30#40#50# (iii) 50#60#70# (iv)
40#50#70#
v What will be the output of print(AR[-2])? Application
(i) 30 (II) 40 (iii)50 (iv)
60
45 Read the passage given below and answer the following Learning
questions…….. Objective
.Ravi has made following list L1=[74,33,22,19,41,65]
L2=[20,40,60]
L1.extend(L2)
Print(L1)

(A) L3=[74,33,22,19,41,65,[20,40,60]] Remembring and


(B) L3==[74,33,22,19,41,65,[20,40,60] understanding
(C) L3=[74,33,22,19,41,65,20,40,60]
(D) None of These

46 Read the passage given below and answer the following Learning
questions…….. Objective

l1=['ab','cd']

for i in l1:

l1.append(i)

print(i)

(A) ab,cd Analysing Evaluating


(B) cd,ab and creating
(C) ab,cd,abcd
(D) infinite
47 Anay is working on a set of data of different datatypes.He
wants to store the student code, name, class and sec of five
students in a single datatype.Later he wants to add and delete
records in the existing datatype.
a. Suggest the most appropriate datatype in Python
for storing the data as per requirement of Anay.
b. Suggest the method of adding a new record in
the existing datatype
c. Anay wants to delete the record of first student
.How can he delete the record.
d. Which operation Anay will perform to add the list
of students from another list to an existing list.

48 Aruna is working with two list named l1 and l2 having integer


elements stored in them. Both the list has some common
elements.
a. She wants to add 2 to the list .Eg: l1+2.But this
operation is giving an Error Message which
Aruna failed to understand.
Now, being a friend of Aruna you are supposed to
rectify the error with best possible explanation
for this.
b. Given a list l2=[10,20,30,40,50,60,70,80,90,100].Aruna
is checking for existence of element 120 in this list
.Which operator she would be using to check an
existence of the same .
c. Can Aruna concatenate both the list .If Yes, how
can she do it.
d. Aruna is comparing two lists l1 and l2 i.e l1==l2.What
must be the possible conditions of getting an
OUTPUT as TRUE.

49 Following is program code to display all the elements of Understanding


the following tuple except ‘d’.
T1 = (‘w’, ‘o’, ‘r’, ‘d’, ‘s’)

T1 = T1[0:3] + T1[ ….. ]


Which statement of the following option can fill the blank
above?
A.T1[-3]
B.T1[-1]
C.T1[0]
D.T1[6]
50 Following is a python program to remove an element ‘3’ Understanding
from the tuple ‘T1’:
T1 = (1,2,3,4,5)
L = list(T1)
…………..
T1 = tuple(L)
Print(T1)
Which of the following option can fill the blank above?
A.remove(T1[3])
B.T1.remove (3)
C.L.remove(3)
D.remove(L[3])

51 A python function secondLargest(t) which takes an input Applying


a tuple t and returns the second largest element in the
tuple. Complete the code from the option given below:
t=(12,13,5,78,45,12)
tr=sorted(t)
secLr=tr[ ] #Statement1
print(“Second Largest value is:”, secLr

What index value should be supplied in statement1 to get


the second largest number in a sorted tuple

A. 2
B. -2
C. 1

D. -1
52 Suresh is writing a function that returns multiple values
which should be immutable as they will be used as key
for dictionary. Suggest suresh, which kind of data
structure be used in this condition. Select the correct
answer from the option given below

A. List
B. Tuple
C. Stack
D. Dictionary
53 Mohan wants to store name, rollno and address of his 5 Knowledge
friends and he wants to update their details time to time Understanding
which one of the following is most appropriate one: Analysis
a. Tuple
b. List
c. String
d. Dictionary
54 If Mohan stores record in dictionary then he will use Knowledge
which function for retrieving the name Understanding
a. display( ) Analysis
b. print( )
c. get( )
d. set( )
55 Richa is working with a program where she gave some Knowledge
values to the function. She doesn’t know the term to
relate these values. Help her by selecting the correct
option.

a) function value

b) arguments or parameters

c) return values

d) function call

56 Mohini wants to know that the symbol : (colon) must be Knowledge


required with which of the following function part?

a) function header

b) function body

c) return statement

d) parameters

ANSWER
CBQ NO Answer
Q.No.1 (a) D
Q.No.1 (b) A
Q.No 2 (a) Answer:- print("This is My school")
Q.No 2 (b) Answer:- print("This is My\\ school")
Q.No.3
a) a. “Good Morning”
b) b.print
c) d.Error
d) b.Line-1 and Line-2
Q.No.4
a) c.greet1,greet2
b) a.name1,name2
c) b.case sensitive
d) d. Line4
QNo. 5 (i) a
(ii) c
(iii) d
(iv) d
Q No. 6 d
QNo.7 (A) (i) math (B) (ii) 8.0

QNo. 8 (A) (ii) random (B) (iii) 9


QNo. 9 A) I → 3, 6, 8, 9 IV → 1, 2, 4, 5, 7
QNO 10 . A) It will display the output only for print(Subject) as Subject is a
list.

QNO.11 i) C
ii) B
iii) B
iv) A
QNO. 12 i) A
ii) A
iii) C
iv) D
Q.No.13 Answer
I. List
Explanation : if we store the names of students of a
class in a list, then it is easy to update the list when
some new students join or some leave the course.
II. Dictionary
Explanation : If our data is being constantly modified
or we need a fast lookup based on a custom key or we
need a logical association between the key : value pair,
it is advised to use dictionaries
III. Sets
Explanation : When we need uniqueness of elements
and to avoid duplicacy it is preferable to use sets.
IV. Tuple
Explanation: Tuples are used when we do not need any
change in the data

Q.NO. 14 Boolean

QNO. 15 a) Using Heron’s Formula


b) yes
c) yes
d) yes
QNO. 16 a) True
b) True
c) False
d) False
QNo. 17 (1) A) **
(2) D)//
(3) B) %
(4) a.. n2>0
(5) c) /
QNo.18 i.(B) ii. (A) iii. (C)
QNo. 19 i.(A)
ii.(B)
QNo. 20 (i) > and = have a space between them. Syntax error. >= is
the correct form.
(ii) the statements of if block must be right indented properly.
(iii) the // operator must be replaced by /
operator. percent = (y-x) * 100 /x
(iv) float
QNo. 21 (i) the required correction in the three input statements is the
casting to float type like this –
a = float(input("Enter first side:"))
b = float(input("Enter second side:"))
c = float(input("Enter third side:"))
(ii) s = (a+b+c) / 2.0
(iii) area = math.sqrt(s*(s-a)*(s-b)*(s-c)).
(iv) math module
QNo 22 (i) > and = have a space between them. Syntax error. >= is
the correct form.
(ii) the statements of if block must be right indented properly.
(iii) the // operator must be replaced by /
operator. percent = (y-x) * 100 /x
(iv) float
QNo. 23 (i) the required correction in the three input statements is the
casting to float type like this –
a = float(input("Enter first side:"))
b = float(input("Enter second side:"))
c = float(input("Enter third side:"))
(ii) s = (a+b+c) / 2.0
(iii) area = math.sqrt(s*(s-a)*(s-b)*(s-c)).
(iv) math module

QNo. 24 a) a
b) c
c) a
d) b
QNo. 25 a) a
b) d
c) d
d) b
QNo.26 a) (D) import csv
b) (C) “Employee.csv”, ’w’
c (D) writer(Csvfile)
d (A) Empno, Name, Desig, Salary
e (C) append(records)
f (D) CsvObj.writerows()
QNo. 27 a (A) pickle 51
b (B) open ‘wb’
c (C) dump(records,file)
d (D) pickle.load(f)
e (C) total_Amt+=R[4]
f (B) except
QNo. 28 1) (a)
2) (a)
Q.No. 29 A
Q.No. 30 C
QNo.31 1 (B) Statement2
2 (D) Statement6
3 (D) Statement6
4 (C) Statement4
5 (D) Statement5
QNo. 32 1 (C) Only Y
2 (B) W and Y
3 (D) X and Z
4 (D) X and Z
5 (C) Only Z
QNo.33 A
QNo.34 B
QNo. 35
1 2
2 1

3 1
4 2
Q.No 36
1 d
2 a
3 b
4 c
QNo.37 1
(B) 2584

2
(C) nterms

3
(B) n2

4
(D) nth

Q38. 1
(D) 1233443221

2
(A) number > 0

3
(B) 10

4
(C) temp

QNo. 39 A
QNo. 40 A
QNo. 41 (i) a.islower()
(ii) a.isupper()
(iii) a.isdigit()
(iv)a.isalpha()

QNo. 42 (i) ('Python is ', 'famous', ' in India')


(ii) I like Hero Bike
(iii) 3buy7buy2buy0
(iv) ['Hello thee', ' study tonight', 'all are welcome']

QNo. 43 i (ii) Global


ii (ii) [[1, 2], [3, 4]]

iii (iv)1
iv (i) 4
v (i) 8
QNo. 44 (II) random
i (i) 3,4
ii (ii) 1, 2
iii (ii) 30#40#50#
iv (iv) 60
Q.No.45 (C)
Q.No.46 (D)
Q. No 47
QNo. 48
QNo. 49 B.T1[-1]
QNo. 50 C.L.remove(3)
Q.No.51 B
Q.No.52 B
Q.No 53 d
Q.No. 54 c
Q.No.55 b. arguments or parameters
Q.No.56 a. function header

Name of the vetter- KAMAL KANt

GUPTA Name of the KV- No 2

KANCHRAPARA Region- KOLKATA


Mobile No- 9493887480

E-mail ID - kamalkant.kv@gmail.com
Name of the Chapter- PYTHON REVISION TOUR

Question Question Content Learning Objective(if


No Provided)
Q1 Python is a low level language.

Q2 Python is a free source language.

Q3 Computer understands machine language.


Python converts low level language to high level

Q4 language.

Q5 Python interpreter interpret the code line by line.

Q6 Python is case sensitive language(T/F)

Q7 A compiler takes an entire program as its input.(T/F)


An interpreter takes multiple lines of code as its

Q8 input(T/F)
Python was named after famous BBC comedy show

Q9 namely Monty Python’s Flying Circus.(T/F)

Q10 Python is not a Cross-platform Language.(T/F)


Q11 Ram and ram are two different names in python
Q12 Python has a rich library of predefined functions
Python got its name from famous BBC comedy show
Q13 “Monty Python’s Flying Circus”.
Q14 Python code is compiled before running
An interpreter processes the program statements one by
Q15 one
Writing comments is mandatory in python programs(T/F)
Q16
Q17 All identifiers in Python are in lower case(T/F).

print(bool(True and True or False)) evaluates to

Q18
The following python statements evaluates to
>>> x = 5
>>> y = x**2//5
Q19 >>> id(x) == id(y)
Write the output of following code:
>>> n1 = 5
>>> n2 = n1
Q20 >>> n2 is n1
Python is an open source, high level language
(A) True Knowledge
(B) False
Q21

An identifier is a user defined name given to a variable or


a constant in a program Knowledge
(A) True
(B) False
Q22

Operators with the same precedence are evaluated in right


to left manner. Knowledge
(A) True
(B) False
Q23

Interactive mode is used when a user wants to run a single Knowledge, Apply
line or one block of code.
(A) True
(B) False
Q24

Script mode is used when the user is working with more Knowledge, Apply
than one single code or a block of code.
(A) True
(B) False
Q25
Q26 The data type of 55/5 is an integer.
Q27 The data type of 55//5 + 55 is an integer.
Q28 The data type of 55%5 is an integer.
Q29 The tuples are only immutable sequences in Python

The data type of the Python Statement list(tuple(str(''))) is


Q30 string.
Variables of simple data types like integers, float, Understanding

Q31 boolean, etc., hold multiple values.


Trying to use a variable that has not been assigned a value Understanding

Q32 gives an error.


We can typecast or change the datatype of the string data Application
accepted from user to an appropriate numeric value when

Q33 using input() function.


Variables whose values can be changed after they are Application

Q34 created and assigned are called immutable.


In order to access any value in the dictionary, we have to Understanding

Q35 specify its key in square brackets [ ]


Tuple data structure is mutable. Knowledge
A. True
B. False

Q36
List data structure is mutable. Understanding
A. True
B. False
Q37
In Python, a variable may be assigned a value of one type, Understanding
and then later assigned a value of a different type:
A. False
B. True
Q38
In Python, a variable must be declared before it is Knowledge
assigned a value:
A. True
B. False
Q39
Variable names can be of any length. Knowledge
A. True
B. False
Q40
the complement operator inverts the value of each bit of the
Q41 operand
immutable Types in Python mean that their values cannot be
changed in place
Q42
Q43 OR ,AND ,// is logical operators ?
Relational operator compare the value of their operand.
Q44
Q45 print( int(6>7-6-7*4) ) will print boolean value
Logical operator not has highest precedence among all the Knowledge
logical operators:
A) True
Q46 B) False
Expression ‘Ab’+2 will result into ‘Ab2’ Analysis
A) True
Q47 B) False
“is” is a membership operator in python Knowledge
A) True
Q48 B) False
Following code will produce True as output: Evaluation
x=10>5>1 and -3<-2<-1
print(x)
A) True
Q49 B)False
‘in’ and ‘not in” are membership operators available in python Knowledge
A) True
Q50 B) False
Q51 The expression str(b) implies that b is converted to string Knowledge
The value of expression 3/5*(7-2) and 3/(5*(7-2)) is Evaluation
Q52 same.
Q53 The expression 4**3**2 is evaluated as (4**3)**2 Understanding
The type casting where user intervention is needed is Knowledge
Q54 explicit type casting.
Q55 () have higher precedence that any other operator. Knowledge
A identifier is the name of any program related object Knowledge
such as variable , function, module, package etc. (True /
Q56 False)
print() always inserts a newline after each output. (True / Understanding
Q57 False)
The + operator (Addition) will always evaluate before * Knowledge
Q58 operator (multiplication). (True / False)
The associativity of operators is either left to right or right Evaluation
Q59 to left.(True / False)
Proper indentation is not necessary in python programs.
Q60 (True / False)
Syntax errors are detected when we have not followed the Knowledge
rules of the particular programming language while
writing a program.
a) Ture
Q61 b) False
Even if a statement or expression is syntactically correct, Knowledge
there might arise an error during its execution.
a) True
Q62 b) False
When syntax error is encountered, Python displays the Knowledge
name of the error and a small description about the error.
a) True
Q63 b) False
The execution of the program will start even there is Knowledge
syntax error.
a) True
Q64 b) False
When an error is encountered in a program, Python Knowledge
interpreter raises or throws an exception.
a) True
Q65 b) False
A relative path always begins with root folder Knowledge
(A) True
Q66 (B) False
readlines() reads the entire file at a time Understanding
(A) True
Q67 (B) False
‘with’ statement ensures that all the resources allocated to Understanding
the file objects get deallocated automatically
(A) True
(B) False
Q68
A binary file stores information in ASCII or Unicode Knowledge
Q69 character
(A) True
(B) False
Opening a file in write mode erases the previous data. Knowledge
(A)True
Q70 (B)False
An if-else statement has less number of conditional Knowledge
checks than Evaluation

Q71 two successive ifs.


The break statement can occur with an if as well as with Knowledge

Q72 loops. Application


The break and continue statements, together are called Knowledge

Q73 compound statements. Understanding


Do..while loop is supported by the python programming Knowledge

Q74 language. Application


We use for loop when we want to perform a task Knowledge
indefinitely until a Application

Q75 particular condition is met Evaluation


To cancel the running of endless loop, you can press Knowledge
Q76 CRTl+C(T/F)
Q77 else if can be used in Python. (T/F) Analysis
The continue statement skips the rest of the loop and Analysis
Q78 causes the next iteration of loop to take place. (T/F)
The else block for a loop executes only in the case of Knowledge
Q79 normal termination of the loop (T/F)
Q80 if,elif,else are not block or compound statements. (T/F) Application
Q81 In Python, only if statement has else clause. Knowledge
Q82 An if statement can either have elif clause or else clause. Understanding
If statement tests a condition and if the condition Analysis
evaluates to true, it carries out some instructions and does
Q83 nothing in case condition evaluates to false.
Q84 Empty statement can not be executed in Python. Understanding
A compound statement represents a group of statements Knowledge
Q85 executed as a unit.
An if-else tests less number of conditions than two Knowledge and
Q86 successive ifs. application of if-else

The range() creates an inerrable sequence. Knowledge and


Q87 application of range()

A for loop can contain another for loop in it. Knowledge and
application of while
Q88 loop

A for loop is termed as a determinable loop Knowledge and


application of while
Q89 loop

The range() can only be used in for loops Knowledge and


Q90 application of range()
Tell whether the statement is True or False : analysis
A while loop is a conditional loop that will repeat the
instructions within itself as long as aconditions remains true
a) True
b) False
Q91
A loop can end in two ways analysis
I. If the while’s condition results in false or for
loop executes with last value of the sequence.
II. If during the loop execution,break statement is
executed .
In this case even if the condition is true or the for
has not executed all the values of sequence,the
loop will still terminate.
a) Only I is correct

Q92 b) Both I & II are incorrect


c) Only II is correct
d) Both I & II are correct

Tell whether the statement is True or False : analysis


A break statement does not skip the rest of the loop &
does not jumps over to the statement following the loop.
a) True
b) False
Q93
Is the following image correct for decision making in a knowledge
flowchart.

a) False
b) True
Q94
Tell whether the statement is True or False : analysis
If the variable is initialized and is not increased or
decreased inside the loop ,then an INFINITE LOOP will
occur.The condition of the loops depends upon the
variable.
a) True
b) False
Q95

The statements within the body of the for loop are Understanding
executed till the range of values is exhausted.
Q96

for loop can not be used to iterate through the elements of Knowledge
strings.
Q97

For a while loop, an equivalent for loop can be written. Analysis


Q98

list(range(3, 15, 3)) will return [3, 6, 9, 12, 15]. Understanding


Q99
else can be used with for and while both. Knowledge
Q100
Python considered the character enclosed in triple quotes Knowledge
as String.(T/F)

a. True
b. False

Q101
String traversal can be done using ‘for’ loop only.(T/F) Knowledge
a. True
b. False

Q102
Strings have both positive and negative indexes. Knowledge
a. True
b. False

Q103
The find() and index() are similar functions. Understanding

a. True
b. False

Q104
String is mutable data type. Knowledge
a. True
b. False

Q105

Q106 String are immutable.[True / False] Understanding


Indexing of string in python starts from 1. [True / False] Understanding

Q107
Backward indexing in string starts from Zero. [True / Applying
False]

Q108
The Python strip() method removes any spaces or Applying
specified characters at the start and end of a string. [True /
False]

Q109
The startswith() string method checks whether a string Understanding

Q110 starts with a particular substring [True / False]


Q111 In Python, function can be return only one value.
The variable declared outside a function is called a global
Q112 variable.
Q113 You can call a function only once after defining it.
Value returning functions should be generally called from
Q114 inside of an expression.
Actual parameters are the parameters specified within a
Q115 pair of parenthesis in the function definition
The pop() and remove() are similar functions. Knowledge
Q116
Lists once created cannot be changed. Knowledge
Q117
The append() can add an element in the middle of the list. Knowledge
Q118
Del statement deletes sub list from a list. Knowledge
Q119
Sort() and sorted() both are similar function. Knowledge
Q120
List immutable data type Remembring and
Q121 understanding
List hold key and values Remembring and
Q122 understanding
l1=[5,7,9,4,12] 5 not in l1 Analysing Evaluating
Q123 and creating
List can be extend Remembring and
Q124 understanding
Mutable means only we can insert elements Remembring and
Q125 understanding

Index of last element in list is n-1, where n is total number of


elements.
Q126
Following two print statements will return same result.

L1 = [1, 5, 9]
L2 = [2, 3, 4]
print(L1 + L1)
Q127 print(L1 * 2)
Q128 We can concatenate only two list at one time.
sort () function Sorts the elements of the given
Q129 list in-place(T/F)
The output of the following code would be:

L1 = [1, 2, 3]
L2 = [1, 2, 3, 4, 5, 6]
print(L1 in L2)
Q130
What is returned when the following code is run? Understanding
def tuple_comparison(tup1, tup2):
return tup1 < tup2
tup1 = (66, 4, 17, 4)
tup2 = (66, 4, 16, 5)
tuple_comparison(tup1, tup2)
A. True

Q131 B. False
True or False? A python tuple can be created without Knowledge
using any parentheses.
A. True
B. False

Q132
Whether Tuple_name[start:stop:step] is a correct syntax Knowledge
for tuple slicing?
A. True

Q133 B. False
True or False? ‘sorted()’ function cannot be used to sort a Knowledge
tuple element.
A.True

Q134 B.False
True or False? index() function finds the first index of a Knowledge
given item and returns the index.
A.True

Q135 F.False
Q136 tuples allowed to have mixed lengths
Q137 tuple have one element
Q138 We can make an empty tuple.
Q139 We Can concatenate tuples.
Q140 Tuples Are Mutable And Use More Memory Than Lists
Tuple data structure is mutable. Remembering and
A. True Understanding
Q141 B. False
The elements of the of a tuple can be deleted Remembering and
A. True Understanding
Q142 B. False
A tuple storing other tuples is called as nested tuple Remembering and
A. True Understanding
Q143 B. False
The + Operator adds one tuple to the end of another tuple Analysing, Evaluating
A. True and Creating
Q144 B. False
A tuple can only have positive indexing. Analysing, Evaluating
A. True and Creating
Q145 B. False
What will be the output of the following Python code snippet? Knowledge
d = {"john":40, "peter":45} Understanding
"john" in d Application
a) True
Q146 b) False
Dictionary values are immutable Knowledge
a) True Understanding
Q147 b) False
List can be converted in Dictionary Knowledge
Q148 a) True Understanding

b) False
It is always not necessary to enclose dictionary in { }. Knowledge
a. True Understanding
Q149 b. False
Dictionary keys are unique and always of string type Knowledge
a. True Understanding
Q150 b. False
A file containing a set of functions you want to include in Knowledge
your application is called a Module.
a. True
b. False
Q151
ord(65) will result into error. Evaluation
a. True
b. False
Q152
len(hello\n world’) will result into 13 Evaluation
a. True
b. False
Q153
Output of expression min(max(False,-3,-4),2,7) is false Evaluation
a. True
b. False

Q154
A function always returns a value Knowledge
a. True
b. False
Q155
Any folder with .py files is designated as Python
Q156 Package- TRUE/FALSE
By using import module anything in the current
Q157 namespace can be imported.- TRUE/FALSE
The file extension for a python program and python
Q158 module is same.- TRUE/FALSE
A package is a file that contains subpackages and

Q159 modules – TRUE/FALSE

A package is attached to site-package folder of python


Q160 installation.-TRYE/FALSE

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy