PCAP-31-03 Free Exam Questions and Answers PDF Updated on Apr-2024
Latest PCAP-31-03 Exam Dumps Recently Updated 145 Questions
NEW QUESTION # 15
What is the expected behavior of the following code?
- A. it outputs 3
- B. the code is erroneous and it will not execute
- C. it outputs 2
- D. it outputs :
Answer: B
NEW QUESTION # 16
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: D
NEW QUESTION # 17
What is the expected behavior of the following code?
- A. it outputs 3
- B. it outputs 'None'
- C. it raises an exception
- D. it outputs 0
Answer: D
NEW QUESTION # 18
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: C
NEW QUESTION # 19
What is the expected output of the following code if there is no file named non existing_file inside the working directory?
- A. 1 3
- B. 1 2 3
- C. 2 2
- D. 2 2 3
Answer: D
NEW QUESTION # 20
What is true about Python packages? (Select two answers)
- A. a package contents can be stored and distributed as an mp3 file
- B. a code designed to initialize a package's state should be placed inside a file named init.py
- C. _pycache_is a folder that stores semi-completed Python modules
- D. the sys.path variable is a list of strings
Answer: B,C
NEW QUESTION # 21
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
- B. import module_a from pypack
- C. import pypack.module_a
- D. from pypack import module_a
Answer: C,D
NEW QUESTION # 22
Which of the following statements are true? (Select two answers)
- A. if invoking open () fails, the value None is returned
- B. the second open () argument is optional
- C. open () is a function which returns an int that represents a physical file handle
- D. instd, outstd, errstd are the names of pre-opened streams
Answer: B,C
NEW QUESTION # 23
What is the expected behavior of the following code?
x = 8 ** (1/3)
y = 2. if x < 2.3 else 3.
print(y)
- A. it outputs 2. 5
- B. it outputs 3.0
- C. the code is erroneus and it will not execute
- D. it outputs 2.0
Answer: D
NEW QUESTION # 24
What is the expected behavior of the following code?
- A. it outputs 0
- B. it outputs 1
- C. it outputs 2
- D. it raises an exception
Answer: D
NEW QUESTION # 25
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. bf. readinto (data = bytearray (16))
- B. data = binfile.read (bytearray (16))
- C. data = bytearray (16) bf.readinto (data)
- D. data = bytearray (binfile.read (16))
Answer: C,D
Explanation:
https://docs.python.org/3/library/functions.html#func-bytearray
https://docs.python.org/3/library/io.html
NEW QUESTION # 26
Which of the following snippets will execute without raising any unhandled exceptions? (Select answers) A)
B)
C)
D)
- A. Option D
- B. Option C
- C. Option A
- D. Option B
Answer: A,B,D
NEW QUESTION # 27
Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers)
- A. a is not None
- B. a() > 2
- C. b( ) > 2
- D. a is b
Answer: A,B,C
NEW QUESTION # 28
Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Select two answers)
- A. isinstance(obj_c,A)
- B. B.VarA == 3
- C. hasattr(obj_b, 'prop_aa')
- D. obj_b.prop_a == 3
Answer: A,C
NEW QUESTION # 29
The following class hierarchy is given. What is the expected output of the code?
- A. BB
- B. AA
- C. CC
- D. BC
Answer: D
NEW QUESTION # 30
Which of the following invocations are valid? (Select two answers)
- A. "python' ,find (" ")
- B. "python" .sort ( )
- C. sort" ("python")
- D. sorted ("python'')
Answer: A,D
NEW QUESTION # 31
Which of the following lines of code will work flawlessly when put independently inside the inc ( ) method in order to make the snippet's output equal to 3? (Select two answers)

- A. self.put (get ( ) + vaI)
- B. self.put (self.prop + vaI)
- C. self.put (self.get ( ) + vaI)
- D. put (self.prop + vaI)
Answer: B,C
NEW QUESTION # 32
What is true about the following snippet? (Select two answers)
- A. the siring I feel fine 'will be seen
- B. the code will raise an unhandled exception
- C. the string it's nice to see you will be seen
- D. the string what a pity will be seen
Answer: A,D
NEW QUESTION # 33
Which one of the platform module functions should be used to determine the underlying platform name?
- A. platform.uname ()
- B. platform.platform ()
- C. platform.python_version()
- D. platform.processor()
Answer: C
NEW QUESTION # 34
Which of the following statements are true? (Select two answers)
- A. a code point is a number assigned to a given character
- B. II in ASCII stands for Information Interchange
- C. ASCII is synonymous with UTF-8
- D. \e is an escape sequence used to mark the end of lines
Answer: B,C
NEW QUESTION # 35
......
Python Institute PCAP-31-03 Real 2024 Braindumps Mock Exam Dumps: https://passcollection.actual4labs.com/Python-Institute/PCAP-31-03-actual-exam-dumps.html