[Oct-2021] Updated Python Institute PCAP PCAP-31-03 Exam Questions BUNDLE PACK [Q20-Q37]

Share

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

  • A. it outputs [0, 1, 2, 3, 4]
  • B. it outputs [2, 4]
  • C. the code is erroneus and it will not execute
  • D. it outputs [4, 2]

Answer: D

 

NEW QUESTION 21
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 22
What is the expected output of the following code?

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

Answer: B

 

NEW QUESTION 23
What is true about Object-Oriented Programming in Python? (Select two answers)

  • A. the same class can be used many times to build a number of objects
  • B. each object of the same class can have a different set of methods
  • C. a subclass is usually more specialized than its superclass
  • D. if a real-life object can be described with a set of adjectives, they may reflect a Python object method

Answer: A,D

 

NEW QUESTION 24
Which of the following invocations are valid? (Select two answers)

  • A. rfind("python","r")
  • B. "python".index("th")
  • C. sorted("python")
  • D. "python".sort ()

Answer: B,C

 

NEW QUESTION 25
Assuming that the code below has been placed inside a file named code.py and executed successfully, which of the following expressions evaluate to True? (Select two answers)

  • A. _name == _main_'
  • B. str(Object) == 'Object'
  • C. len(ClassB.__bases__) == 1
  • D. ClassA. _module_ == 'ClassA'

Answer: C

 

NEW QUESTION 26
Which of the following lambda function definitions are correct? (Select two answers)

  • A. lambda X : None
  • B. lambda : 3,1415
  • C. lambda x : def fun(x): return x
  • D. lambda lambda: lambda * lambda

Answer: A,B

 

NEW QUESTION 27
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 3
  • B. 1 2
  • C. 2 3
  • D. 1 2 3

Answer: A

 

NEW QUESTION 28
A compiler is a program designed to (select two answers)

  • A. rearrange the source code to make it clearer
  • B. check the source code in order to see if its correct
  • C. execute the source code
  • D. translate the source code into machine code

Answer: B,D

Explanation:
https://www.thoughtco.com/what-is-a-compiler-958322

 

NEW QUESTION 29
Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Select two answers) string = 'python' [::2] string = string[-1] + string[-2]

  • A. string[0] == string[-1]
  • B. len (string] == 3
  • C. string[0] == 'o'
  • D. string is None

Answer: C

 

NEW QUESTION 30
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 31
Assuming that the following snippet has been successfully executed, which of the equations are True? (Select two answers)

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

Answer: A,D

Explanation:

 

NEW QUESTION 32
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) )

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

Answer: A

 

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

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

Answer: C

 

NEW QUESTION 34
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 35
What is the expected output of the following code?

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

Answer: A

 

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

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

Answer: A

 

NEW QUESTION 37
......

Pass Python Institute PCAP-31-03 Exam – Experts Are Here To Help You: https://www.exam4docs.com/PCAP-31-03-study-questions.html

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