[Aug-2021] Updated Python Institute PCAP PCAP-31-03 Exam Questions BUNDLE PACK [Q35-Q58]

Share

[Aug-2021] Updated Python Institute PCAP PCAP-31-03 Exam Questions BUNDLE PACK

Master The Python Institute Content PCAP-31-03 EXAM DUMPS WITH GUARANTEED SUCCESS!

NEW QUESTION 35
The following class hierarchy is given. What is the expected output of the code?

  • A. CC
  • B. BB
  • C. AA
  • D. BC

Answer: D

 

NEW QUESTION 36
What is the expected behavior of the following code?
x - 3 % 1
y -1 if x > else 0
print (y)

  • A. the code is erroneous and it will not execute
  • B. it outputs 0
  • C. it outputs 1
  • D. it outputs -1

Answer: B

 

NEW QUESTION 37
Which of the following lines of code will work flawlessly when put independently inside the add_new () method in order to make the snippet's output equal to [0, 1, 1] ? (Select two answers)

  • A. self .put (self.store[1])
  • B. put self.store(1])
  • C. self .put self.get () [-1])
  • D. self put stire(1])

Answer: A,D

 

NEW QUESTION 38
What is the expected behavior of the following code?

  • A. the code is erroneous and it will not execute
  • B. it outputs 1
  • C. it outputs 3
  • D. it outputs 2

Answer: B

 

NEW QUESTION 39
What will be the value of the i variable when the while e loop finishes its execution?

  • A. 0
  • B. the variable becomes unavailable
  • C. 1
  • D. 2

Answer: C

Explanation:

 

NEW QUESTION 40
What is the expected behavior of the following code?

  • A. the code is erroneous and it will not execute
  • B. it outputs 3
  • C. it outputs 1
  • D. it outputs 2

Answer: B

 

NEW QUESTION 41
What is the output of the following piece of code?

  • A. antbatcame1
  • B. ant'bat'came1
  • C. ant"bat"came1
  • D. ant bat came1

Answer: C

Explanation:

 

NEW QUESTION 42
What is the expected output of the following code?

  • A. 0
  • B. 1
  • C. an exception is raised
  • D. 2

Answer: C

 

NEW QUESTION 43
What is the expected output of the following code?

  • A. True
  • B. None
  • C. False
  • D. 0

Answer: A

 

NEW QUESTION 44
What is the expected output of the following snippet?

  • A. 0
  • B. 1
  • C. the code is erroneous
  • D. 2

Answer: C

Explanation:

 

NEW QUESTION 45
Assuming that the following snippet has been successfully executed, which of the equations are False? (Select two answers)

  • A. len(a) == len(b)
  • B. b[0] - 1 == a[0]
  • C. a[0] - 1 == b[0]
  • D. a[0] = b[0]

Answer: B,D

Explanation:
>>> print(len(a)==len(b))
True
>>> print(a[0]-1==b[0])
True
>>> print(a[0]==b[0])
False
>>> print(b[0]-1 == a[0])
False

 

NEW QUESTION 46
You are going to read 16 bytes from a binary file into a bytearray called dat a. Which lines would you use? (Select two answers)

  • A. data = bytearray (binfile.read (16))
  • B. data = bytearray (16) bf.readinto (data)
  • C. data = binfile.read (bytearray (16))
  • D. bf. readinto (data = bytearray (16))

Answer: A,B

Explanation:
https://docs.python.org/3/library/functions.html#func-bytearray
https://docs.python.org/3/library/io.html

 

NEW QUESTION 47
Assuming that the following inheritance set is in force, which of the following classes are declared properly?
(Select two answers)

  • A. class Class_2(B,D): pass
  • B. class Class_3(A,C): pass
  • C. class Class_4 (D, A) : pass
  • D. class Class_1(C,D): pass

Answer: C,D

 

NEW QUESTION 48
What is the expected behavior of the following code?

  • A. it raises an exception
  • B. it outputs 6
  • C. it outputs 1
  • D. it outputs 3

Answer: B

 

NEW QUESTION 49
Which one of the platform module functions should be used to determine the underlying platform name?

  • A. platform.processor()
  • B. platform.platform ()
  • C. platform.python_version()
  • D. platform.uname ()

Answer: B

 

NEW QUESTION 50
If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:

  • A. except Ex1+Ex2:
  • B. except Ex1, Ex2:
  • C. except Ex1 Ex2:
  • D. except (ex1, Ex2):

Answer: A

 

NEW QUESTION 51
What is the expected output of the following code?

  • A. an exception is raised
  • B. 0
  • C. 1
  • D. 2

Answer: B

 

NEW QUESTION 52
Which of the following snippets will execute without raising any unhandled exceptions? (Select answers) A)

B)

C)

D)

  • A. Option C
  • B. Option B
  • C. Option A
  • D. Option D

Answer: A,B,D

 

NEW QUESTION 53
Assuming that the code below has been executed successfully, which of the following expressions evaluate to True? (Select two answers)

  • A. 'prop' in Class.__diet
  • B. len(Object.__diet__) == 1
  • C. 'var' in Object.__diet__
  • D. 'var1 in Class, diet

Answer: B,C

 

NEW QUESTION 54
The first parameter of each method:

  • A. holds a reference to the currentlv processed object
  • B. is always set to None
  • C. is set by the first argument's value
  • D. is set to a unique random value

Answer: A

Explanation:
The first argument of every class method, including init, is always a reference to the current instance of the class. By convention, this argument is always named self. In the init method, self refers to the newly created object; in other class methods, it refers to the instance whose method was called

 

NEW QUESTION 55
What is the expected behavior of the following code?

  • A. it outputs 1
  • B. the code is erroneous and it will not execute
  • C. it outputs 3
  • D. it outputs 2

Answer: B

 

NEW QUESTION 56
What is the expected output of the following code if existing_file is the name of a file located inside the working directory?

  • A. 1 2
  • B. 0
  • C. 2 3
  • D. 1 2 3

Answer: B

 

NEW QUESTION 57
What is the expected behavior of the following snippet?

It will:

  • A. print3
  • B. cause a runtime exception on line 01
  • C. cause a runtime exception on line 02
  • D. cause a runtime exception on line 03

Answer: A

Explanation:

 

NEW QUESTION 58
......

Pass Python Institute PCAP-31-03 Exam – Experts Are Here To Help You: https://www.passexamdumps.com/PCAP-31-03-valid-exam-dumps.html

Get Latest Python Institute PCAP PCAP-31-03 Practice Test For Quick Preparation: https://drive.google.com/open?id=1g06n8rFNQrpBmwEFjf6K2WzYWg7yKoiv