0% found this document useful (0 votes)
3 views

2.Python Unit 2 Question Bank

The document consists of a series of multiple-choice questions related to Python programming concepts, covering topics such as data types, operators, control flow, and string manipulation. Each question presents four options, from which the correct answer must be selected. The questions are designed to test knowledge and understanding of Python syntax and functionality.

Uploaded by

Anand Duraiswamy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

2.Python Unit 2 Question Bank

The document consists of a series of multiple-choice questions related to Python programming concepts, covering topics such as data types, operators, control flow, and string manipulation. Each question presents four options, from which the correct answer must be selected. The questions are designed to test knowledge and understanding of Python syntax and functionality.

Uploaded by

Anand Duraiswamy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

QBForUnit2cit1

Multiple Choice
Identify the choice that best completes the statement or answers the question.

____ 1. Python converts the source code into an intermediate form called___

a. Object code

b. Byte Code

c. Machine code

d. Virtual code

____ 2. Identify the words which best describes Python.

a. Interpreted

b. reliable

c. simple

d. All of these

____ 3. Which of the following is true for variable names in Python?


a. unlimited length
b. all private members must have leading and trailing underscores
c. underscore and ampersand are the only two special charaters allowed
d. none
____ 4. Which of the following is not a keyword?
a. eval
b. assert
c. nonlocal
d. pass
____ 5. Is Python case sensitive when dealing with identifiers?
a. yes
b. no
c. sometimes only
d. none of the mentioned
____ 6. Which of the following is invalid?
a. _a = 1
b. __a = 1
c. __str__ = 1
d. none of the mentioned
____ 7. Which operator gives the remainder after division?

a. /

b. //
c. %

d. *

____ 8. Which of the following is a valid string literal?

a. "Computer"

b. 'Computer'

c. "'Computer'"

d. All of these

____ 9. Python allows you to specify Unicode text by prefixing

the string with which character?

a. U

b. R

c. 5

d. A

____ 10. Which of these will not be stored as a float?

a. 23.0

b. 1/3

c. 15

d. ABC

____ 11. Select the integer literal.

a. 10.345

b. '9'

c. 9

d. "9"

____ 12. Comments start with which symbol?

a. 00

b. //

c. #

d. *
____ 13. All keywords in Python are in
a. lower case
b. UPPER CASE
c. Capitalized
d. none
____ 14. Which of the following cannot be a variable?
a. __init__
b. in
c. it
d. on
____ 15. What is the output when following code is executed ?
>>> print(r"\nhello")
The output is
a. a new line and hello
b. \nhello
c. the letter r and then hello
d. Error
____ 16. What is the output when following statement is executed ?
>>>print("new" "line")
a. Error
b. Output equivalent to print ‘new\nline’
c. newline
d. new line
____ 17. what is the output:
>>> print 0xA + 0xB + 0xC :
a. 0xA0xB0xC
b. Error
c. 0x22
d. 33
____ 18. What is the output of “hello”+1+2+3 ?
a. hello123
b. hello
c. Error
d. hello6
____ 19. What is the output when following code is executed ?
>>>print("D", end = ',')
>>>print("C", end = ',')
>>>print("B", end = ',')
>>>print("A", end = ',')
a. DCBA
b. A, B, C, D
c. D C B A
d. D, C, B, A will be displayed on four lines
e. None of these
____ 20. What is the output when following statement is executed?(python 3.xx)
>>>print(format("Welcome", "10s"), end = '#')
>>>print(format(111, "4d"), end = '#')
>>>print(format(924.656, "3.2f"))
a. Welcome# 111#924.66
b. Welcome#111#924.66
c. Welcome#111#.66
d. Welcome # 111#924.66
____ 21. Say s=”hello” what will be the return value of type(s)?
a. int
b. bool
c. str
d. String
____ 22. What is the output of this code?

>>> print("print "'print hello"" ')

a. print" 'print hello" 'print("print hello")

b. An error message

c. 'print print hello'

d. print "print print hello"

____ 23. Which line of code produces an error?

a. "one" + "2"

b. '5' + 6

c. 3 + 4

d. "7" + 'eight'

____ 24. What is the output of this code?

>>>spam = "eggs"

>>>print(spam*3)

a. Spamspamspam

b. eggseggseggs

c. "spamspamspam"

d. spam*3

____ 25. What is the output of this code?

>>>int("39" + "49")

a. 007900

b. 00394900

c. 3949
d. (003900+ 004900)

____ 26. What is the output of this code?

>>> float("123" * int(input("Enter a number:")))

Enter a number: 3

a. 0012312312300

b. 00369.900

c. 123123123.0

d. 369.9

____ 27. What will be the status of the following list after fourth pass of bubble sort used for arranging the
following elements in descending order? {34, –6, 12, –3, 45, 25}

a. {34, 12, –3, 45, 25, –6}

b. {34, 12, 45, 25, –3, –6}

c. {34, 45, 25, 12, –3, –6}

d. {45, 34, 25, 12, –3, –6}

____ 28. Which of these is a valid variable name in Python?

a. This is a variable

b. This_Is_A_VARIABLE

c. This-is-a-variable

d. ^var

____ 29. variable can be removed using which __ keyword.

a. remove

b. clear

c. del

d. delete

____ 30. - To specify more than one statements in a single line,

use a ___ to separate the statements.

a. ,

b. ;
c. :

d. /

____ 31. The input() function takes user's input as a

a. integer

b. float

c. string

d. character

____ 32. Bitwise operator can be applied on which data type?

a. integer

b. float

c. string

d. list

____ 33. Which operator treats operand as a sequence of bits?

a. Relational

b. Arithmetic

c. Bitwise

d. Logical

____ 34. Which operator is also known as string repetition operator?

a. +

b. *

c. &

d. "

____ 35. If, x = 5; y =__; and print(x+y) gives 12, then y is

a. 5

b. 17

c. 7

d. "7"

____ 36. Which of the following results in True?


a. >>>9=9 and 1==1

b. >>>3==5 and 7==3

c. >>>7!=1 and 5==5

d. >>>4<1 and 1>6

____ 37. Which of the following results in False?

a. >>> 9=9 or 1==1

b. >>> 3==4 or 7==7

c. >>> 7!=1 or 5==5

d. >>> 4<1 or 1>6

____ 38. Which is the correct operator for power(xy)?


a. x^y
b. X**y
c. X^^y
d. None of the mentioned
____ 39. What is the order of precedence in python?
i) Parentheses
ii) Exponential
iii) Division
iv) Multiplication
v) Addition
vi) Subtraction
a. i,ii,iii,iv,v,vi
b. ii,i,iii,iv,v,vi
c. ii,i,iv,iii,v,vi
d. i,ii,iii,iv,vi,v
____ 40. Operators with the same precedence are evaluated in which manner?
a. Left to Right
b. Right to Left
____ 41. What is the output of this expression, 3*1**3?
a. 27
b. 9
c. 3
d. 1
____ 42. Which one of the following have the same precedence?
a. Addition and Subtraction
b. Multiplication and Division
c. a and b
d. None of the mentioned
____ 43. Which one of the following have the highest precedence in the expression?
a. Exponential
b. Addition
c. Multiplication
d. Parentheses
____ 44. Which of the following statements about floating point expressions is NOT
correct in Python 3? [Answers are rounded to one decimal place, where
applicable.]
a. 6 / 5 evaluates to 1
b. 10.0 ** 3 evaluates to 1000.0
c. 3.0 * 5 + 2.0 evaluates to 17.0
d. 3 / 5 evaluates to 0.6
e. 3.0 / 5 evaluates to 0.6
____ 45. Evaluate the following expression:

not (100<0 or 100>20)

a. True

b. False

____ 46. Identify the correct arithmetic expression in Python

a. 11(12+13)

b. (5*6)(7+8)

c. 4*(3-2)

d. 5***3

____ 47. >>> print (format(56.78991, '.3f'))

a. 56.789

b. 5.6789

c. 0.56789

d. 56789

____ 48. The following statement will produce _ lines of output.

print('Good\n Morning \n World\n Bye')

a. 1

b. 2

c. 3

d. 4

____ 49. Identify the expression that may result in arithmetic

overflow.
a. a*b

b. a**b

c. a/b

d. a+b

____ 50. Which statement ends the current iteration of the loop and continues with the next one?

a. break

b. continue

c. skip

d. pass

____ 51. Which statement is used to terminate the execution of the nearest enclosing loop in which it appears?

a. pass

b. break

c. continue

d. jump

____ 52. What will be the output after the following?


x = '28' + '26'
print(x)
a. 54
b. 2826
c. 49
d. 44
____ 53. Which statement is used to stop the current iteration of the loop and continues with the next one?

a. pass

b. break

c. continue

d. jump

____ 54. Which statement indicates a NOP?

a. pass

b. break

c. continue

d. jump
____ 55. What is the data type of x after the following statement?
x = ['Today', 'Tomorrow', 'Yesterday']
a. List
b. Dictionary
c. Tuple
d. String
____ 56. What would happen if we replace the break statement in the code with a 'continue'?

a. It will stop executing

b. It would run forever

c. You will have to press Ctrl + C

d. There would be no change

____ 57. Evaluate the following expression:

True or False

a. True

b. False

____ 58. Which data type will you use to represent the following data values?

Number of days in a year

a. integer

b. float

c. string

d. complex

____ 59. Identify the valid numeric literals in Python.

a. 5678

b. 5,678

c. 5678.0

d. 0.5678

e. 0.56e+10

____ 60. Literals of the form a+bi are called

a. integer

b. string
c. complex number

d. float

____ 61. Which of these in not a core datatype?


a. Lists
b. Dictionary
c. Tuples
d. Class
____ 62. Given a function that does not return any value, What value is thrown by it by default when executed in
shell.
a. int
b. bool
c. void
d. None
____ 63. Following set of commands are executed in shell, what will be the output?

>>>str="hello"

>>>str[:2]

>>>
a. he
b. lo
c. olleh
d. hello
____ 64. What is the return type of function id ?
a. int
b. float
c. bool
d. dict
____ 65. What error occurs when you execute?
apple = mango
a. SyntaxError
b. NameError
c. ValueError
d. TypeError
____ 66. Carefully observe the code and give the answer.
def example(a):
a = a + '2'
a = a*2
return a

>>>example("hello")
a. indentation Error
b. cannot perform mathematical operation on strings
c. hello2
d. hello2hello2
____ 67. What dataype is the object below ?
L = [1, 23, ‘hello’, 1]
a. List
b. dictionary
c. array
d. tuple
____ 68. In order to store values in terms of key and value we use what core datatype.
a. List
b. tuple
c. class
d. dictionary
____ 69. What will be the output after the following?
for i in range(1,5):
print(i, end='')
a. 15
b. 12345
c. 1234
d. 012345
____ 70. What will be the output after the following?
for i in range(1,25,5):
print(i, end=' ')
a. 1 6 11 16 21
b. 1 5 10 15 20 25
c. 1 5 25
d. 16111621
____ 71. What will be the output after the following?
for i in range(5):
print(i, end='')
a. 5
b. 1 5
c. 012345
d. 01234
____ 72. What will be the output after the following?
x = 'Python'
y = 'y' in x
print(y)
a. [1]
b. y
c. True
d. False
____ 73. What is the output when following statement is executed ?
>>>"a"+"bc"
a. a
b. bc
c. bca
d. abc
____ 74. What is the average value of the code that is executed below ?
>>>grade1 = 80
>>>grade2 = 90
>>>average = (grade1 + grade2) / 2
a. 85
b. 85.0
c. 95
d. 95.0
____ 75. Which part of if statement should be indented?

a. The first statement

b. All the statements

c. Statements within the if block

d. None of these

____ 76. What will be the output after the following statements?
x = 80
y = 50
z = y if (y > x) else x
print(z)
a. 1
b. 0
c. 50
d. 80
____ 77. Which of the following is placed after the if condition?

a. ;

b. .

c. :

d. ,

____ 78. How many numbers will be printed?

i = 10

while True:

print(i)

i=i-1

if i<=7:

break

a. 1

b. 2

c. 3

d. 4
____ 79. What is the return value of trunc() ?
a. int
b. bool
c. float
d. None
____ 80. What will be the data type of x after the following statement?
x = (34, 81, 50)
a. List
b. String
c. Dictionary
d. Tuple
____ 81. How many lines will be printed by this code?

while False:

print("Hello")

a. 1

b. 0

c. 10

d. countless

____ 82. What will be the output after the following?


x, y = 0, 1
while y < 10:
print(y, end=' ')
x, y = y, x + y
a. 1 1 2 3 5 8
b. 112358
c. 0123456789
d. 0 2 4 6 8
____ 83. How many numbers will be printed?

i=5

while i>=0:

print(i)

i=i-1

a. 5

b. 6

c. 4

d. 0

____ 84. What type of loop is this?


x=1
while x < 5:
print(x, end='')
a. Closed loop
b. One time loop
c. Infinite loop
d. Evergreen loop
____ 85. What will be the output after the following ?
x = [5, 4, 3, 2]
x.append(1)
print(x)
a. [5, 4, 3, 2]
b. 5, 4, 3, 2, 1
c. 5432
d. [5, 4, 3, 2, 1]
____ 86. What is the maximum possible length of an identifier?
a. 31 characters
b. 63 characters
c. 79 characters
d. none of the mentioned
____ 87. Which of the following is an invalid variable?
a. my_string_1
b. 1st_string
c. foo
d. _
____ 88. Why are local variable names beginning with an underscore discouraged?
a. they are used to indicate a private variables of a class
b. they confuse the interpreter
c. they are used to indicate global variables
d. they slow down execution
____ 89. What will be the output after the following ?
x = ['Sunday', 'Monday', 'Tuesday']
y = x[1] + x[2]
print(y)
a. MondayTuesday
b. SundayMonday
c. SunMonday
d. Monday Tuesday
____ 90. Following set of commands are executed in shell, what will be the output?

>>>str="hello"
>>>str[:2]
>>>
a. he
b. lo
c. olleh
d. hello
____ 91. What is the output when following statement is executed ?
>>>"abcd"[2:]
a. a
b. ab
c. cd
d. dc
____ 92. What is the output when following code is executed ?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]
a. olleh
b. hello
c. h
d. o
____ 93. Which of the following is an invalid statement?
a. abc = 1,000,000
b. a b c = 1000 2000 3000
c. a,b,c = 1000, 2000, 3000
d. a_b_c = 1,000,000

x = 20
y = 40
z = y if (y > x) else x
print(z)

____ 94. What will be the output after the above statements?
a. True
b. False
c. 20
d. 40
e. Error

x = 65
y = 53
z = y if (x % 2 == 0) else x
print(z)

____ 95. What will be the output after the above statements?
a. True
b. False
c. 65
d. 53

x = input('Enter a number: ')

____ 96. What will be the data type of x after the above statement if input entered is 18 ?
a. Float
b. String
c. List
d. Integer
x = ['Today', 'Tomorrow', 'Yesterday']

____ 97. What is the data type of x after the above statement?
a. List
b. Dictionary
c. Tuple
d. String

x = [25, 35, 45]


y = x[0]
print(y)

____ 98. What will be the output after the above statements?
a. x0
b. 25
c. 35
d. 45

x = [[0.0, 1.0, 2.0],[4.0, 5.0, 6.0]]


y = x[0][1] + x[1][0]
print(y)

____ 99. What will be the output after the above statements?
a. 1.0
b. 4.0
c. 5.0
d. 6.0

x = [5, 4, 3, 2]
x.insert(1, 0)
print(x)

____ 100. What will be the output after the above statements?
a. [5, 1, 3, 2, 0]
b. [5, 0, 4, 3, 2]
c. [0, 5, 4, 3, 2]
d. [1, 5, 4, 3, 2]

x = [5, 4, 3, 2, 1]
y = [10, 5, 0]
x.extend(y)
print(y)

____ 101. What will be the output after the above statements?
a. [5, 4, 3, 2, 1, 10, 5, 0]
b. []
c. [10, 5, 0, 5, 4, 3, 2, 1]
d. [10, 5, 0]

x = ['25', 'Today', '53', 'Sunday', '15']


x.sort()
print(x)

____ 102. What will be the output after the above statements?
a. ['Today', 'Sunday', '15', '25', '53']
b. ['Sunday', 'Today', '15', '25', '53']
c. ['15', '25', '53', 'Sunday', 'Today']
d. ['15', '25', '53', 'Today', 'Sunday']

x = [5, 3, 6, 2, 4, 0, 7]
del x[0:4]
print(x)

____ 103. What will be the output after the above statements?
a. []
b. [5, 3, 6, 2, 7]
c. [5, 3, 6, 2, 4, 0]
d. [4, 0, 7]

x=8
if x > 8:
print(20)
else:
print(10)

____ 104. What will be the output after the above statements?
a. 20
b. x
c. 10
d. 8

x = 40
if x > 10:
print(20)
elif x == 40:
print(10)
else:
print(30)

____ 105. What will be the output after the above statements?
a. 20
b. 40
c. 10
d. 30

x = 15
if x > 15:
print(0)
elif x == 15:
print(1)
else:
print(2)

____ 106. What will be the output after the above statements?
a. 0
b. 1
c. 2
d. 15

x=5
if x > 15:
print('yes')
elif x == 15:
print('equal')
else:
print('no')

____ 107. What will be the output after the above statements?
a. 15
b. yes
c. equal
d. no

x=1
while x < 10:
print(x, end='')
x=x+1

____ 108. What will be the output after the above statements?
a. 123456789
b. 1
c. 10
d. 2

x=0
while x < 10:
print(x, end='')
x += 4

____ 109. What will be the output after the above statements?
a. 0123456789
b. 123456789
c. 4123456789
d. 048

x=0
y=4
while x + y < 10:
print(x, end='')
x += 1
____ 110. What will be the output after the above statements?
a. 012345
b. 0123456789
c. 4123456789
d. 048

for i in range(1,5):
print(i, end='')
if i == 3:
break

____ 111. What will be the output after the above statements?
a. 123
b. 1234
c. 12
d. 12345

for i in range(1,5):
if i == 3:
continue
print(i, end=' ')

____ 112. What will be the output after the above statements?
a. 1 2 4
b. 1 2 3 4
c. 1 2
d. 1 2 3

Multiple Response
Identify one or more choices that best complete the statement or answer the question.

____ 113. _ Identify the correct variable name

a. this_is_a_variable

b. 123abc = 19.22

c. ThisBook = "Python"

d. %name = "xyz"

____ 114. Which of the following will run without errors(multiple answers possible) ?
a. round(45.8)
b. round(6352.898,2)
c. round()
d. round(7463.123,2,1)
____ 115. Select all options that print
hello-how-are-you
a. print('hello', 'how', 'are', 'you')
b. print('hello', 'how', 'are', 'you' + '-' * 4)
c. print('hello-' + 'how-are-you')
d. print('hello' + '-' + 'how' + '-' + 'are' + '-' + 'you')
____ 116. The following is displayed by a print function call:
tom
dick
harry
Select all of the function calls that result in this output
a. print('"tom
\ndick
\nharry"')
b. print(”’tom
dick
harry”’)
c. print(‘tom\ndick\nharry’)
d. print(‘tom \
dick\
harry’)
____ 117. In python we do not specify types,it is directly interpreted by the compiler, so consider the following
operation to be performed.

>>>x = 13 / 2

objective is to make sure x has a integer value, select all that apply (python 3.xx)
a. x = 13 // 2
b. x = int(13 / 2)
c. x = 13 / 2
d. x = 13 % 2
____ 118. Which of the following results in a SyntaxError?(Multiple answers possible)
a. '"Once upon a time…", she said.'
b. "He said, "Yes!""
c. '3\'
d. "'That's okay"
QBForUnit2cit1
Answer Section

MULTIPLE CHOICE

1. ANS: B PTS: 1
2. ANS: D PTS: 1
3. ANS: A PTS: 1 REF: Variable names can be of any length.
4. ANS: A PTS: 1 REF: eval can be used as a variable.
5. ANS: A PTS: 1 REF: Case is always significant.
6. ANS: D PTS: 1
REF: All the statements will execute successfully but at the cost of reduced readability.
7. ANS: C PTS: 1
8. ANS: D PTS: 1
9. ANS: A PTS: 1
10. ANS: C PTS: 1
11. ANS: B PTS: 1
12. ANS: C PTS: 1
13. ANS: D PTS: 1
REF: True, False and None are capitalized while the others are in lower case.
14. ANS: B PTS: 1 REF: in is a keyword.
15. ANS: B PTS: 1 DIF: 1 TOP: 2
16. ANS: C PTS: 1 DIF: 1 TOP: 2
17. ANS: D PTS: 1 DIF: 1 TOP: 2
18. ANS: C PTS: 1
19. ANS: E PTS: 1 DIF: 1 TOP: 2
20. ANS: D PTS: 2 DIF: 1 TOP: 2
21. ANS: C PTS: 1 DIF: 1 TOP: 2
22. ANS: A PTS: 1
23. ANS: B PTS: 1
24. ANS: B PTS: 1
25. ANS: C PTS: 1
26. ANS: C PTS: 2 DIF: 2
27. ANS: D PTS: 2 DIF: 2 TOP: 2
28. ANS: B PTS: 1
29. ANS: C PTS: 1
30. ANS: B PTS: 1
31. ANS: C PTS: 1
32. ANS: A PTS: 1
33. ANS: C PTS: 1
34. ANS: B PTS: 1
35. ANS: A PTS: 1
36. ANS: A PTS: 1
37. ANS: D PTS: 1
38. ANS: B PTS: 1 REF: In python, power operator is x**y i.e. 2**3=8.
39. ANS: A PTS: 1 REF: For order of precedence, just remember this
PEDMAS.
40. ANS: A PTS: 1 REF: None.
41. ANS: C PTS: 1
REF: First this expression will solve 1**3 because exponential have higher precedence than
multiplication, so 1**3 = 1 and 3*1 = 3. Final answer is 3.
42. ANS: C PTS: 1 REF: None.
43. ANS: D PTS: 1 REF: None.
44. ANS: A PTS: 1
REF: This statement is true in Python 2.7 but not in Python 3! In Python 3, you must use // if you want
integer division.
45. ANS: B PTS: 1
46. ANS: C PTS: 1
47. ANS: A PTS: 1
48. ANS: D PTS: 1
49. ANS: B PTS: 1
50. ANS: B PTS: 1
51. ANS: B PTS: 1
52. ANS: B PTS: 1
53. ANS: C PTS: 1
54. ANS: A PTS: 1
55. ANS: A PTS: 1
56. ANS: B PTS: 1
57. ANS: B PTS: 1
58. ANS: A PTS: 1
59. ANS: A PTS: 1
60. ANS: C PTS: 1
61. ANS: D PTS: 1 DIF: 1 REF: Class is a user defined datatype.
TOP: 2
62. ANS: D PTS: 1 DIF: 1 TOP: 2
63. ANS: A PTS: 1 DIF: 1
REF: We are printing only the 1st two bytes of string and hence the answer is “he”.
TOP: 2
64. ANS: A PTS: 1 DIF: 1
REF: Execute help(id) to find out details in python shell.id returns a integer value that is unique.
TOP: 2
65. ANS: B PTS: 1 DIF: 1
REF: mango is not defined hence name error. TOP: 2
66. ANS: A PTS: 1 DIF: 1
REF: Python codes have to be indented properly. TOP: 2
67. ANS: A PTS: 1 DIF: 1
REF: List datatype can store any values within it. TOP: 2
68. ANS: D PTS: 1 DIF: 1
REF: Dictionary stores values in terms of keys and values. TOP: 2
69. ANS: C PTS: 1
70. ANS: A PTS: 1
71. ANS: D PTS: 1
72. ANS: C PTS: 1
73. ANS: D PTS: 1 DIF: 1 TOP: 2
74. ANS: B PTS: 1 DIF: 1
REF: Cause a decimal value to appear as output. TOP: 2
75. ANS: C PTS: 1
76. ANS: D PTS: 1
77. ANS: C PTS: 1
78. ANS: C PTS: 1
79. ANS: A PTS: 1 DIF: 1
REF: Executle help(math.trunc) to get details. TOP: 2
80. ANS: D PTS: 1
81. ANS: B PTS: 1
82. ANS: A PTS: 1
83. ANS: B PTS: 1
84. ANS: C PTS: 1
85. ANS: D PTS: 1
86. ANS: D PTS: 1 REF: Identifiers can be of any length.
87. ANS: B PTS: 1 REF: Variable names should not start with a number.
88. ANS: A PTS: 1
REF: As Python has no concept of private variables, leading underscores are used to indicate variables
that must not be accessed from outside the class.
89. ANS: A PTS: 1
90. ANS: A PTS: 1
REF: We are printing only the 1st two bytes of string and hence the answer is “he”.
91. ANS: C PTS: 1 DIF: 1 TOP: 2
92. ANS: D PTS: 1 DIF: 1 TOP: 2
93. ANS: B PTS: 1 REF: Spaces are not allowed in variable names.
94. ANS: D PTS: 1
95. ANS: C PTS: 1
96. ANS: B PTS: 1
97. ANS: A PTS: 1
98. ANS: B PTS: 1
99. ANS: C PTS: 1
100. ANS: B PTS: 1
101. ANS: D PTS: 1
102. ANS: C PTS: 1
103. ANS: D PTS: 1
104. ANS: C PTS: 1
105. ANS: A PTS: 1
106. ANS: B PTS: 1
107. ANS: D PTS: 1
108. ANS: A PTS: 1
109. ANS: D PTS: 1
110. ANS: A PTS: 1
111. ANS: A PTS: 1
112. ANS: A PTS: 1

MULTIPLE RESPONSE
113. ANS: A, C PTS: 1
114. ANS: A, B PTS: 2 DIF: 1
REF: Execute help(round) in the shell to get details of the parameters that are passed into the round
function. TOP: 2
115. ANS: C, D PTS: 2 DIF: 1 REF: Execute in the shell.
TOP: 2
116. ANS: C PTS: 2 DIF: 1
REF: The \n adds a new line and \ allows the string to extend. TOP: 2
117. ANS: A, B PTS: 2 DIF: 1
REF: // is integer operation in python 3.0 and int(..) is a type cast operator.
TOP: 2
118. ANS: B, C PTS: 2 DIF: 1 REF: Carefully look at the quotes
TOP: 2

You might also like