Sep 22, 2021 Step by Step Guide to Prepare for PCAP-31-03 Exam BrainDumps
Python Institute PCAP PCAP-31-03 Real Exam Questions and Answers FREE Updated on 2021
NEW QUESTION 28
What is the expected out of the following code of the file named zero_length_existing_file is a zero-length file located inside the working directory?
- A. 0
- B. 1
- C. an errno value corresponding to file not found
- D. 2
Answer: A
NEW QUESTION 29
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 30
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 31
A class constructor (Select two answers)
- A. cannot be invoked directly from inside the class
- B. can be invoked directly from any of the superclasses
- C. can return a value
- D. can be invoked directly from any of the subclasses
Answer: A,D
NEW QUESTION 32
Assuming that the following code has been executed successfully, selected the expression which evaluate to True (Select two answers) Def f (x, y); Nom, denom = x, y def g ( ) ; Return nom / denom A = f (1, 2) B = f (3, 4)
- A. a ! = b
- B. a is not None
- C. a ( ) == 4
- D. b ( ) == 4
Answer: A,B
NEW QUESTION 33
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. str(Object) == 'Object'
- B. _name == _main_'
- C. len(ClassB.__bases__) == 1
- D. ClassA. _module_ == 'ClassA'
Answer: B,C
NEW QUESTION 34
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_1(C,D): pass
- C. class Class_3(A,C): pass
- D. class Class_4 (D, A) : pass
Answer: C,D
NEW QUESTION 35
Which of the following expression evaluate to True? (Select two answers)
- A. 't' . upper ( ) in 'Thames'
- B. 'in' in 'in'
- C. 'in not' in 'not'
- D. 'in' in 'Thames'
Answer: A,B
NEW QUESTION 36
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 37
What is the expected behavior of the following code?
- A. it raises an exception
- B. it outputs 0
- C. it outputs 1
- D. it outputs 2
Answer: B
NEW QUESTION 38
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 39
A Python module named pymod, py contains a function named pyfun ( ).
Which of the following snippets will let you invoke the function? (Select two answers)
- A. From pymod import pyfun
Pyfun ( ) - B. Import pyfun from pymod
Pyfun ( ) - C. From pymod import '
Pymod.pyfun ( ) - D. Import pymod
Pymod. Pyfun ( )
Answer: A,D
NEW QUESTION 40
Which of the following lambda definitions are correct? (Select two answers)
- A. lambda x, y; (x, y)
- B. lambda (x, y = x\\y x%y
- C. lambda x, y; x\\y - x%y
- D. lanbda x, y; return x\\y - x%y
Answer: A,C
NEW QUESTION 41
What is the expected output of the following code?
- A. 0
- B. 1
- C. 2
- D. 3
Answer: B
Explanation:
NEW QUESTION 42
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 43
What is the expected behavior of the following code?
- A. it outputs 0
- B. it raises an exception
- C. it outputs 1
- D. it outputs 2
Answer: B
NEW QUESTION 44
What is the expected output of the following code?
- A. 0
- B. 1
- C. an exception is raised
- D. 2
Answer: C
NEW QUESTION 45
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, 21 ? (Select two answers)
- A. self.queue.append(self.get last() +1)
- B. self.queue.append(get_Iast() + 1)
- C. queue.append(self.get last () + 1)
- D. self.queue.append(self.queue[+1]
Answer: A
NEW QUESTION 46
What is a true about python class constructors? (Select two answers)
- A. the constructor must return a value other than None
- B. there can the more than one constructor in a Python class.
- C. the constructor must have at least one parameter
- D. the constructor is a method named_init_
Answer: C,D
NEW QUESTION 47
Which of the following literals reflect the value given as 3 4. 2 3 (select two answers)
- A. .3423e2
- B. .3423e-2
- C. 3423e-2
- D. 3423e2
Answer: A,C
Explanation:
NEW QUESTION 48
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 49
......
Ultimate Guide to Prepare PCAP-31-03 Certification Exam for Python Institute PCAP: https://www.validvce.com/PCAP-31-03-exam-collection.html
PCAP-31-03 Ultimate Study Guide: https://drive.google.com/open?id=1eyGCY4ygaMF-vh59dNjxwYJ83reXW9R_
