What will the value of the i variable be when the following loop finishes its execution?
A. 10
B. the variable becomes unavailable
C. 11
D. 9
Which of the following literals reflect the value given as 34.23? (Select two answers)
A. .3423e2
B. 3423e-2
C. .3423e-2
D. 3423e2
What is the expected output of the following snippet?
A. 1
B. 4
C. 2
D. 3
A keyword (Select two answers)
A. can be used as an identifier
B. is defined by Python's lexis
C. is also known as a reserved word
D. cannot be used in the user's code
Which line can be used instead of the comment to cause the snippet to produce the following expected output? (Select two answers)
Expected output: 1 2 3
Code:
A. c, b, a = b, a, c
B. c, b, a = a, c, b
C. a, b, c = c, a, b
D. a, b, c = a, b, c
How many stars (*) does the following snippet print?
A. the code is erroneous
B. five
C. three
D. four
Which of the listed actions can be applied to the following tuple? (Select two answers)
A. tup [:]
B. tup.append (0)
C. tup [0]
D. del tup
Assuming that 1st is a four-element list is there any difference between these two statements?
A. yes, there is, the first line empties the list, the second line deletes the list as a whole
B. yes, there is, the first line deletes the list as a whole, the second line just empties the list
C. no, there is no difference
D. yes, there is, the first line deletes the list as a whole, the second line removes all the elements except the first one
The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns. Which of the invocations should be used instead of XXX?
A. print (get(self))
B. print (self.get())
C. print (get())
D. print (self.get (val))
What is the expected behavior of the following code?
A. it raises an exception
B. it outputs True
C. it outputs False
D. it outputs nothing
What is true about Python class constructors? (Choose two.)
A. there can be more than one constructor in a Python class
B. the constructor must return a value other than None
C. the constructor is a method named __init__
D. the constructor must have at least one parameter
What is the expected output of the following code if there is no file named non_existing_file inside the working directory?
A. 1 2 4
B. 1 2 3 4
C. 2 4
D. 1 3
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
What is the expected behavior of the following code?
A. it raises an exception
B. it outputs nothing
C. it outputs True
D. it outputs False
Which of the following expressions evaluate to True? (Choose two.)
A. `in' in `Thames'
B. `in' in `in'
C. `in not' in `not'
D. `t'.upper() in `Thames'