Which of the following expressions evaluate to True? (Select two answers)
A. str(1-1) in '012345?39'[:2]
B. 'phd' in 'alpha'
C. 'deb' not in 'abcde' [::-1]
D. 'True' not in 'False'
A two-parameter lambda function raising its first parameter to the power of the second parameter should be declared as:
A. lambda (x, y) = x ** y
B. lambda (x, y): x ** y
C. def lambda (x, y): return x ** y
D. lambda x, y: x ** y
What can you do if you don't like a long package path tike this one0 import alpha.beta.gamma.delta.epsiIon.zeta
A. you can make an alias for the name using the a 1 i a s keyword
B. nothing; you need to come to terms with it
C. you can shorten it to alpha. zeta and Python will find the proper connection
D. you can make an alias for the name using die as keyword
A variable stored separately in every object is called:
A. there are no such variables, all variables are shared among objects
B. a class variable
C. an object variable
D. an instance variable
Which of the following expression evaluate to True? (Select two answers)
A. len('\'? == 1
B. len(""" """) == o
C. chr(ordCA') + 1) == 'B'
D. ord("Z") - ord("z") -- ord("0")
Select the valid fun () invocations:
(select two answers)
def fun (a, b=0):
return a*b
A. fun(b=1)
B. fun (a=0)
C. fun(b=1, 0)
D. fun (1)
Assuming that the code below has been executed successfully, which of the following expressions will always evaluate to True? (Select two answers)
import random
v1 = random. random()
v2 = random. random()
A. len(random.sample([1,2,3],2)) > 2
B. v1 == v2
C. random.choice([1,2,3]) >=1
D. v1 >= 1
What is the expected behavior of the following code?
A. It outputs False
B. It outputs nothing
C. It outputs True
D. It raises an exception
Which of the following expressions evaluate to True? (Select two answers)
A. 121 +1 == int ('1' + 2 * '2')
B. float ('3.14') == str('3.'+'14')
C. 'xyz'.lower() 'XY'
D. '8' + '8' !=2 * '8'
Is it possible to safely check if a class object has a certain attribute0
A. yes, by using the hasattr attribute
B. yes. by using the hasattr () method
C. yes, by using the hasattr () function
D. no, it is not possible
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Python Institute exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your PCAP-31-03 exam preparations and Python Institute certification application, do not hesitate to visit our Vcedump.com to find your solutions here.