What is the expected behavior of the following code?
A. it outputs 1
B. it outputs 2
C. the code is erroneous and it will not execute
D. it outputs 3
What is the expected output of the following snippet?
A. abc
B. The code will cause a runtime exception
C. ABC
D. 123
What is the expected output of the following snippet?
A. the code is erroneous
B. 3 C. 7
D. 15
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
What is the expected behavior of the following code?
A. it outputs 0
B. it outputs 1
C. it raises an exception
D. it outputs 2
What is the expected output of the following code?
A. abcef
B. The program will cause a runtime exception error
C. acdef
D. abdef
Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Select two answers) A. obj_b.prop_a == 3
B. hasattr(obj_b, 'prop_aa')
C. isinstance(obj_c,A)
D. B. VarA == 3
What is true about Python packages? (Select two answers)
A. the__name__variable always contains the name of a package
B. a package is a group of related modules
C. the pyc extension is used to mark semi-compiled Python packages
D. a package is a single file whose name ends with the pa extension
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
Which of the following expression evaluate to True? (Select two answers)
A. Option A
B. Option B
C. Option C
D. Option D
Which of the equations are True? (Select two answers)
A. chr (ord (x)) = = x
B. ord (ord (x)) = = x
C. chr (chr (x)) = = x
D. ord (chr (x)) = = x
Which of the following words can be used as a variable name? (Select two valid names)
A. for
B. True
C. true
D. For
What is the expected output of the following code?
A. 21
B. 2
C. 3
D. 12
What is the expected output of the following code if there is no file named non existing_file inside the working directory?
A. 2 2
B. 1 3
C. 1 2 3
D. 2 2 3
Assuming that the following code has been executed successfully, selected the expression which evaluate to True (Select two answers)
def f (x,y): nom, denom = x, y def g():
return nom / denom
return g a = f(!,2) b = f(3,4)
A. a ( ) == 4
B. a is not None
C. b ( ) == 4
D. a ! = b