[Sep-2021] Updated Python Institute PCAP PCAP-31-03 Exam Questions BUNDLE PACK [Q38-Q57]

Share

[Sep-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 38
What is the expected behavior of the following code?

  • A. it outputs True
  • B. it outputs nothing
  • C. it raises an exception
  • D. it outputs False

Answer: A

 

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

  • A. False upper
  • B. True upper
  • C. True lower
  • D. False lower

Answer: A

 

NEW QUESTION 40
Which of the following expressions evaluate to True? (Select two answers)

  • A. '1' + '1' + '1' < '1' * 3'
  • B. 'AbC' lower () < 'AB'
  • C. '3.14' != str(3.1415)
  • D. 121 + 1 != '!' + 2 * '2'

Answer: C,D

 

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

  • A. True lower
  • B. True upper
  • C. False lower
  • D. False upper

Answer: A

 

NEW QUESTION 42
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 43
Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers)

  • A. b( ) > 2
  • B. a is b
  • C. a is not None
  • D. a() > 2

Answer: A,C,D

 

NEW QUESTION 44
The following expression
1+-2
is:

  • A. equal to 2
  • B. equal to -1
  • C. equal to 1
  • D. invalid

Answer: B

Explanation:

 

NEW QUESTION 45
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 46
With regards to the directory structure below, select the proper forms of the directives in order to import module_a. (Select two answers)

  • A. import module_a from pypack
  • B. import module_a
  • C. import pypack.module_a
  • D. from pypack import module_a

Answer: C,D

 

NEW QUESTION 47
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 48
The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns. Which of the invocations should be used instead of XXX?

  • A. print (get(self))
  • B. print (get())
  • C. print (self.get (val))
  • D. print (self.get())

Answer: D

 

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

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

Answer: B

 

NEW QUESTION 50
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 51
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 52
Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Select two answers)

  • A. B.VarA == 3
  • B. hasattr(obj_b, 'prop_aa')
  • C. obj_b.prop_a == 3
  • D. isinstance(obj_c,A)

Answer: B,D

 

NEW QUESTION 53
How many elements will the list2 list contain after execution of the following snippet?
list1 = [False for i in range (1, 10) ]
list2 = list1 [-1:1:-1]

  • A. seven
  • B. three
  • C. zero
  • D. five

Answer: A

Explanation:

 

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

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

Answer: B

Explanation:

 

NEW QUESTION 55
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 56
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 2
  • D. it outputs 3

Answer: C

 

NEW QUESTION 57
......

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

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