Question 111
Assuming that the following code has been executed successfully, which of the expressions evaluate to True? (Choose two.)
A. b() == 4
B. a != b
C. a is not None
D. a() == 4
Question 112
What is the expected output of the following code?
A. 3
B. 5
C. 4
D. an exception is raised
Question 113
Which of the following lambda definitions are correct? (Choose two.)
A. lambda x,y: (x,y)
B. lambda x,y: return x//y - x%y
C. lambda x,y: x//y - x%y
D. lambda x,y = x//y - x%y
Question 114
Which of the following statements are true? (Choose two.)
A. if invoking open () fails, an exception is raised
B. open () requires a second argument
C. open () is a function which returns an object that represents a physical file
D. instd, outstd. errstd are the names of pre-opened streams
Question 115
What is the expected behavior of the following code?
A. the code is erroneous and it will not execute
B. it outputs 1
C. it outputs -1
D. it outputs 0
Question 116
Which of the following snippets will execute without raising any unhandled exceptions? (Choose two.)
A.
B.
C.
D.
Question 117
Which of the following expressions evaluate to True? (Choose two.)
A. '8'+'8'!=2*'8'
B. 'xYz'.lower()>'XY'
C. float('3.14')==str('3.' + '14')
D. 121+1==int('1' + 2 * '2')
Question 118
What is the expected behavior of the following code?
A. it raises an exception
B. it outputs 3
C. it outputs 1
D. it outputs 6
Question 119
What is the expected behavior of the following code?
A. the code is erroneous and it will not execute
B. it outputs 2.0
C. it outputs 2.5
D. it outputs 3.0
Question 120
What is the expected behavior of the following code?
A. it outputs [4, 2]
B. it outputs [2, 4]
C. it outputs [0, 1, 2, 3, 4]
D. the code is erroneous and it will not execute