image


PCAP-31-03 Dumps

PCAP-31-03 Braindumps PCAP-31-03 Real Questions PCAP-31-03 Practice Test PCAP-31-03 Actual Questions


AICPA


PCAP-31-03


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?


image


  1. 3

  2. 5

  3. 4

  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. 1

  2. 0

  3. -1

  4. 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)

image


  1. a ( ) == 4

  2. 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?


image


  1. you can make an alias for the name using the alias keyword

  2. nothing, you need to come to terms with it

  3. you can shorten it to alpha. zeta and Python will find the proper connection

  4. 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

  1. len("""

    """) == o

  2. chr(ordCA’) + 1) == ‘B’

  3. ord("Z") – ord("z") — ord("0")


Answer: B

The bases property contains:

  1. base class locations (addr)

  2. base class objects (class)

  3. base class names (str)

  4. base class ids (int)


Answer: C


Question: 44


What is the expected output of the following snippet?


image


  1. 3

  2. 1

  3. 2

  4. the code is erroneous


Answer: A


Question: 45


A variable stored separately in every object is called:

  1. there are no such variables, all variables are shared among objects

  2. a class variable

  3. an object variable

  4. 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?


image


  1. it outputs 2

  2. the code is erroneous and it will not execute

  3. it outputs 1

  4. 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)

image


  1. ‘var’ in Object. dict

  2. ‘prop’ in Class. dict

  3. len(Object. diet ) == 1

  4. ‘var1 in Class, dict


Answer: A,C


Question: 48


The following expression 1+-2

is:

  1. equal to 1

  2. invalid

  3. equal to 2

  4. 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:

  1. except Ex1 Ex2:

  2. except (ex1, Ex2):

  3. except Ex1, Ex2:

  4. 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)


image


  1. import pypack.module_a

  2. import module_a from pypack

  3. import module_a

  4. from pypack import module_a


Answer: A,D


image

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


$FWXDO ([DP 4XHVWLRQV .LOOH[DPV FRP SURYLGHV DFWXDO H[DP TXHVWLRQV WKDW DUH H[SHULHQFHG LQ WHVW FHQWHUV 7KHVH TXHVWLRQV DUH XSGDWHG UHJXODUO\ WR HQVXUH WKH\ DUH XS WR GDWH DQG UHOHYDQW WR WKH ODWHVW H[DP V\OODEXV %\ VWXG\LQJ WKHVH DFWXDO TXHVWLRQV FDQGLGDWHV FDQ IDPLOLDUL]H WKHPVHOYHV ZLWK WKH FRQWHQW DQG IRUPDW RI WKH UHDO H[DP


([DP 'XPSV .LOOH[DPV FRP RIIHUV H[DP GXPSV LQ 3') IRUPDW 7KHVH GXPSV FRQWDLQ D FRPSUHKHQVLYH FROOHFWLRQ RI TXHVWLRQV DQG DQVZHUV WKDW FRYHU WKH H[DP WRSLFV %\ XVLQJ WKHVH GXPSV FDQGLGDWHV FDQ HQKDQFH WKHLU NQRZOHGJH DQG LPSURYH WKHLU FKDQFHV RI VXFFHVV LQ WKH FHUWLILFDWLRQ H[DP


3UDFWLFH 7HVWV .LOOH[DPV FRP SURYLGHV SUDFWLFH WHVWV WKURXJK WKHLU GHVNWRS 9&( H[DP VLPXODWRU DQG RQOLQH WHVW HQJLQH 7KHVH SUDFWLFH WHVWV VLPXODWH WKH UHDO H[DP HQYLURQPHQW DQG KHOS FDQGLGDWHV DVVHVV WKHLU UHDGLQHVV IRU WKH DFWXDO H[DP 7KH SUDFWLFH WHVWV FRYHU D ZLGH UDQJH RI TXHVWLRQV DQG HQDEOH FDQGLGDWHV WR LGHQWLI\ WKHLU VWUHQJWKV DQG ZHDNQHVVHV


*XDUDQWHHG 6XFFHVV .LOOH[DPV FRP RIIHUV D VXFFHVV JXDUDQWHH ZLWK WKHLU H[DP GXPSV 7KH\ FODLP WKDW E\ XVLQJ WKHLU PDWHULDOV FDQGLGDWHV ZLOO SDVV WKHLU H[DPV RQ WKH ILUVW DWWHPSW RU WKH\ ZLOO UHIXQG WKH SXUFKDVH SULFH 7KLV JXDUDQWHH SURYLGHV DVVXUDQFH DQG FRQILGHQFH WR LQGLYLGXDOV SUHSDULQJ IRU FHUWLILFDWLRQ H[DPV


8SGDWHG &RQWHQW .LOOH[DPV FRP UHJXODUO\ XSGDWHV LWV TXHVWLRQ EDQN DQG H[DP GXPSV WR HQVXUH WKDW WKH\ DUH FXUUHQW DQG UHIOHFW WKH ODWHVW FKDQJHV LQ WKH H[DP V\OODEXV 7KLV KHOSV FDQGLGDWHV VWD\ XS WR GDWH ZLWK WKH H[DP FRQWHQW DQG LQFUHDVHV WKHLU FKDQFHV RI VXFFHVV


7HFKQLFDO 6XSSRUW .LOOH[DPV FRP SURYLGHV IUHH [ WHFKQLFDO VXSSRUW WR DVVLVW FDQGLGDWHV ZLWK DQ\ TXHULHV RU LVVXHV WKH\ PD\ HQFRXQWHU ZKLOH XVLQJ WKHLU VHUYLFHV 7KHLU FHUWLILHG H[SHUWV DUH DYDLODEOH WR SURYLGH JXLGDQFH DQG KHOS FDQGLGDWHV WKURXJKRXW WKHLU H[DP SUHSDUDWLRQ MRXUQH\


'PS .PSF FYBNT WJTJU IUUQT LJMMFYBNT DPN WFOEPST FYBN MJTU

.LOO \RXU H[DP DW )LUVW $WWHPSW *XDUDQWHHG