[Nov 25, 2021] PCAP-31-03 Exam Dumps 100% Same Q&A In Your Real Exam
PCAP-31-03 Test Engine Dumps Training With 120 Questions
For more info read reference:
Python Institute Official Website Preparation Material FAQs and Guide
NEW QUESTION 71
An operator able to perform bitwise shifts is coded as (select two answers)
- A. <<
- B. ++
- C. - -
- D. >>
Answer: A,D
NEW QUESTION 72
If you want to access an exception object's components and store them in an object called e, you have to use the following form of exception statement
- A. except Exception as e:
- B. except e=Exception:
- C. such an action is not possible in Python
- D. except Exception(e):
Answer: A
NEW QUESTION 73
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 74
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. queue.append(self.get last () + 1)
- C. self.queue.append(self.queue[+1]
- D. self.queue.append(get_Iast() + 1)
Answer: A
NEW QUESTION 75
Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Select two answers)
- A. class Class_1(C,D): pass
- B. class Class_2(B,D): pass
- C. class Class_4 (D, A) : pass
- D. class Class_3(A,C): pass
Answer: A,C
NEW QUESTION 76
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 3
- B. 1 2
- C. 1 3
- D. 2 3
Answer: C
NEW QUESTION 77
A method for passing the arguments used by the following snippet is called:
- A. positional
- B. named
- C. sequential
- D. keyword
Answer: A
NEW QUESTION 78
The following class hierarchy is given. What is the expected output of the code?
- A. CC
- B. BC
- C. AA
- D. BB
Answer: B
NEW QUESTION 79
What will the value of the i variable be when the following loop finishes its execution?
- A. 0
- B. 1
- C. the variable becomes unavailable
- D. 2
Answer: A
NEW QUESTION 80
What is the expected behavior of the following code?
- A. it outputs [0, 1, 2, 3, 4]
- B. the code is erroneus and it will not execute
- C. it outputs [4, 2]
- D. it outputs [2, 4]
Answer: C
NEW QUESTION 81
What is true about Python packages? (Select two answers)
- A. hashbang is the name of a built-in Python function
- B. the__name__variable content determines the way in which the module was run
- C. __pycache__is the name of a built-in variable
- D. a package can be stored as a tree of sub-directories/sub-folders
Answer: A
NEW QUESTION 82
The first parameter of each method:
- A. holds a reference to the currently 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: C
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 83
Which of the following statement are true? (Select two answers)
- A. if open ( ) 's second argument is 'r' the file must exist or open will fail
- B. the second open ( ) argument describes the open mode and defaults to 'w'
- C. if open ( )'s second argument is 'w' and the invocation succeeds, the previous file's content is lost
- D. closing an open file is performed by the closefile ( ) function
Answer: A,C
NEW QUESTION 84
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 (16) bf.readinto (data)
- B. data = binfile.read (bytearray (16))
- C. bf. readinto (data = bytearray (16))
- D. data = bytearray (binfile.read (16))
Answer: A,D
Explanation:
Reference:
https://docs.python.org/3/library/io.html
NEW QUESTION 85
Which of the following statements are true? (Select two answers)
- A. II in ASCII stands for Information Interchange
- B. ASCII is synonymous with UTF-8
- C. \e is an escape sequence used to mark the end of lines
- D. a code point is a number assigned to a given character
Answer: A,B
NEW QUESTION 86
Executing the following snippet
will cause the dct:
- A. to hold two keys named 'pi' linked to 3.14 and 3.1415 respectively
- B. to hold one key named 'pi' linked to 3.1415
- C. to hold two keys named 'pi' linked to 3.1415
- D. to hold two key named 'pi' linked to 3.14 and 3.1415
Answer: B
NEW QUESTION 87
What can you do if you don't like a long package path tike this one0 import alpha.beta.gamma.delta.epsiIon.zeta
- A. you can shorten it to alpha. zeta and Python will find the proper connection
- B. nothing; you need to come to terms with it
- C. you can make an alias for the name using die as keyword
- D. you can make an alias for the name using the a 1 i a s keyword
Answer: C
NEW QUESTION 88
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 pypack.module_a
- B. from pypack import module_a
- C. import module_a
- D. import module_a from pypack
Answer: A,B
NEW QUESTION 89
What is the expected output of the following snippet?
- A. ABC
- B. abc
- C. 0
- D. The code will cause a runtime exception
Answer: D
Explanation:
NEW QUESTION 90
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 3
- B. 1 2
- C. 1 3
- D. 2 3
Answer: C
NEW QUESTION 91
Which of the following expressions evaluate to True? (Select two answers)
- A. '1' + '1' + '1' < '1' * 3'
- B. 121 + 1 != '!' + 2 * '2'
- C. 'AbC' lower () < 'AB'
- D. '3.14' != str(3.1415)
Answer: B,D
NEW QUESTION 92
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 (16) bf.readinto (data)
- B. data = binfile.read (bytearray (16))
- C. bf. readinto (data = bytearray (16))
- D. data = bytearray (binfile.read (16))
Answer: A,D
Explanation:
https://docs.python.org/3/library/functions.html#func-bytearray
https://docs.python.org/3/library/io.html
NEW QUESTION 93
......
Topics of PCAP - Certified Associate in Python Programming (PCAP-31-03) Exam
The syllabus for the PCAP-31-03 dumps is listed below in detail of each section and their topics:
1. Control and Evaluations (25%)
Objectives covered by this section:
- Boolean operators: not and or
- numeric operators: * / % // + â
- conditional statements: if, if-else, if-elif, if-elif-else
- controlling loop execution: break, continue
- string operators: * +
- the pass instruction
- basic concepts: interpreting and the interpreter, compilation and the compiler, language elements, lexis, syntax and semantics, Python keywords, instructions, indenting
- assignments and shortcut operators
- bitwise operators: ~ & ^ | « »
- accuracy of floating-point numbers
- basic input and output: input(), print(), int(), float(), str() functions
- operators: unary and binary, priorities and binding
- building loops: while, for, range(), in, iterating through sequences
- relational operators (== != > >= < <= ), building complex Boolean expressions
- literals: Boolean, integer, floating-point numbers, scientific notation, strings
- formatting print() output with end= and sep= arguments
- simple strings: constructing, assigning, indexing, slicing comparing, immutability
- expanding loops: while-else, for-else, nesting loops, and conditional statements
- simple lists: constructing vectors, indexing, and slicing, the len() function
2. Data Aggregates (25%)
Objectives covered by this section:
- lists in lists: matrices and cubes
- tuples: indexing, slicing, building, immutability
- strings in detail: ASCII, UNICODE, UTF-8, immutability, escaping using the \ character, quotes and apostrophes inside strings, multiline strings, copying vs. cloning, advanced slicing, string vs. string, string vs. non-string, basic string methods (upper(), lower(), isxxx(), capitalize(), split(), join(), etc.) and functions (len(), chr(), ord()), escape characters
- dictionaries: building, indexing, adding and removing keys, iterating through dictionaries as well as their keys and values, checking key existence, keys(), items(), and values() methods
- lists in detail: indexing, slicing, basic methods (append(), insert(), index()) and functions (len(), sorted(), etc.), del instruction, iterating lists with the for loop, initializing, in and not in operators, list comprehension, copying and cloning
- tuples vs. lists: similarities and differences, lists inside tuples and tuples inside lists
3. Functions and Modules (25%)
Objectives covered by this section:
- hiding module entities
- lambda functions, defining and using
- map(), filter(), reduce(), reversed(), sorted() functions and the sort() method
- writing and using modules, the name variable
- name scopes, name hiding (shadowing), the global keyword
- defining and invoking your functions and generators
- converting generator objects into lists using the list() function
- import directives, qualifying entities with module names, initializing modules
- pyc file creation and usage
- return and yield keywords, returning results, the None keyword, recursion
- constructing and distributing packages, packages vs. directories, the role of the init.py file
- parameters vs. arguments, positional keyword and mixed argument passing, default parameter values
- the if operator
- Python hashbangs, using multiline strings as module documentation
4. Classes, Objects, and Exceptions (25%)
Objectives covered by this section:
- name mangling
- the role of the str method
- invoking methods, passing and using the self-argument/parameter
- the anatomy of an exception object
- exceptions hierarchy, assigning more than one exception to one except branch
- assertions
- input/output basics: opening files with the open() function, stream objects, binary vs. text files, newline character translation, reading and writing files, byte array objects
- adding your exceptions to an existing hierarchy
- using predefined exceptions and defining your ones
- read(), readinto(), readline(), write(), close() methods
- class methods: defining and using the self-parameter meaning and usage
- class attributes: class variables and instance variables, defining, adding, and removing attributes, explicit constructor invocation
- inheritance and overriding, finding class/object components
- writing and using constructors
- the init method
- single inheritance vs. multiple inheritances
- introspection: dict, name, module, bases properties, examining class/object structure
- the try-except-else-finally block, the raise statement, the except-as variant
- hasattr(), type(), issubclass(), isinstance(), super() functions
- defining your classes, superclasses, subclasses, inheritance, searching for missing class components, creating objects
PCAP-31-03 Practice Test Pdf Exam Material: https://www.easy4engine.com/PCAP-31-03-test-engine.html
PCAP-31-03 Questions Pass on Your First Attempt Dumps for Python Institute PCAP Certified: https://drive.google.com/open?id=1fOgGwrqElecDxAGYQOGDyCaE0Opgfjq1

