3 Months Free Update
3 Months Free Update
3 Months Free Update
Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Select two answers)
string = 'SKY' (:: -1)
string = string (-1)
A Python module named pymod, py contains a function named pyfun ( ).
Which of the following snippets will let you invoke the function? (Select two answers)
If you want to transform a string into a list of words, what invocation would you use? (Select two answers)
Expected output:
What would you use instead of XXX if you want to check whether a certain ‘ key' exists in a dictionary called diet? (Select two answers)
II
if XXX:
print("Key exists")
What is the expected output of the following code?
def foo(x,y,z):
return x(y) - x(z)
print{f00(lambda x: x % 2, 2, 1) )
Assuming that String is six or more letters long, the following slice
String[1:-2]
is shorter than the original string by:
Which of the following literals reflect the value given as 34.23? (select two answers)
The following class hierarchy is given. What is the expected output of the code?
Python's built-in function named open () tries to open a file and returns:
You need data which can act as a simple telephone directory. You can obtain it with the following clauses (choose two relevant variants; assume that no other items have been created before)
What is the expected behavior of the following code?
x = 8 ** (1/3)
y = 2. if x < 2.3 else 3.
print(y)
An operator able to perform bitwise shifts is coded as (select two answers)
There is a stream named s open for writing. What option will you select to write a line to the stream''
Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers.)
A property that stores information about a given class's super-classes is named:
Assuming that the following snippet has been successfully executed, which of the equations are False? (Select two answers)
Which one of the platform module functions should be used to determine the underlying platform name?
If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write: