PCAP-31-03 Dumps
PCAP-31-03 Braindumps PCAP-31-03 Real Questions PCAP-31-03 Practice Test PCAP-31-03 Actual Questions
Certified Associate in Python Programming - 2023
https://killexams.com/pass4sure/exam-detail/PCAP-31-03
Question: 38
What is the expected output of the following code?
3
5
4
an exception is raised
Answer: A
Question: 39
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) )
1
0
-1
an exception is raised
Answer: C
Question: 40
Assuming that the following code has been executed successfully, selected the expression which evaluate to True (Select two answers)
a ( ) == 4
a is not None C. b ( ) == 4
D. a ! = b
Answer: A,B
Question: 41
What can you do if you don’t like a long package path like this one?
you can make an alias for the name using the alias keyword
nothing, you need to come to terms with it
you can shorten it to alpha. zeta and Python will find the proper connection
you can make an alias for the name using the as keyword
Answer: D Explanation:
Reference: https://stackoverflow.com/questions/706595/can-you-define-aliases-for-imported-modules-in-python
Question: 42
Which of the following expression evaluate to True? (Select two answers) A. len(”•) == 1
len("""
""") == o
chr(ordCA’) + 1) == ‘B’
ord("Z") – ord("z") — ord("0")
Answer: B
The bases property contains:
base class locations (addr)
base class objects (class)
base class names (str)
base class ids (int)
Answer: C
Question: 44
What is the expected output of the following snippet?
3
1
2
the code is erroneous
Answer: A
Question: 45
A variable stored separately in every object is called:
there are no such variables, all variables are shared among objects
a class variable
an object variable
an instance variable
Answer: D Explanation:
Reference: https://dev.to/ogwurujohnson/distinguishing-instance-variables-from-class-variables-in-python-81
What is the expected behavior of the following code?
it outputs 2
the code is erroneous and it will not execute
it outputs 1
it outputs 3
Answer: A
Question: 47
Assuming that the code below has been executed successfully, which of the following expressions evaluate to True? (Select two answers)
‘var’ in Object. dict
‘prop’ in Class. dict
len(Object. diet ) == 1
‘var1 in Class, dict
Answer: A,C
Question: 48
The following expression 1+-2
is:
equal to 1
invalid
equal to 2
equal to -1
Answer: D
Question: 49
If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:
except Ex1 Ex2:
except (ex1, Ex2):
except Ex1, Ex2:
except Ex1+Ex2:
Answer: D
Question: 50
With regards to the directory structure below, select the proper forms of the directives in order to import module_a. (Select two answers)
import pypack.module_a
import module_a from pypack
import module_a
from pypack import module_a
Answer: A,D
6$03/( 48(67,216
7KHVH TXHVWLRQV DUH IRU GHPR SXUSRVH RQO\ )XOO YHUVLRQ LV XS WR GDWH DQG FRQWDLQV DFWXDO TXHVWLRQV DQG DQVZHUV
.LOOH[DPV FRP LV DQ RQOLQH SODWIRUP WKDW RIIHUV D ZLGH UDQJH RI VHUYLFHV UHODWHG WR FHUWLILFDWLRQ H[DP SUHSDUDWLRQ 7KH SODWIRUP SURYLGHV DFWXDO TXHVWLRQV H[DP GXPSV DQG SUDFWLFH WHVWV WR KHOS LQGLYLGXDOV SUHSDUH IRU YDULRXV FHUWLILFDWLRQ H[DPV ZLWK FRQILGHQFH +HUH DUH VRPH NH\ IHDWXUHV DQG VHUYLFHV RIIHUHG E\ .LOOH[DPV FRP
'PS .PSF FYBNT WJTJU IUUQT LJMMFYBNT DPN WFOEPST FYBN MJTU
.LOO \RXU H[DP DW )LUVW $WWHPSW *XDUDQWHHG