[Dec-2021] Exam PCAP-31-03 New Brain Dump Professional - PrepAwayTest [Q37-Q58]

Share

[Dec-2021] Exam PCAP-31-03: New Brain Dump Professional - PrepAwayTest

Free PCAP-31-03 Exam Dumps to Improve Exam Score


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:

  • simple strings: constructing, assigning, indexing, slicing comparing, immutability
  • accuracy of floating-point numbers
  • simple lists: constructing vectors, indexing, and slicing, the len() function
  • the pass instruction
  • conditional statements: if, if-else, if-elif, if-elif-else
  • controlling loop execution: break, continue
  • Boolean operators: not and or
  • relational operators (== != > >= < <= ), building complex Boolean expressions
  • basic input and output: input(), print(), int(), float(), str() functions
  • numeric operators: * / % // + –
  • string operators: * +
  • operators: unary and binary, priorities and binding
  • literals: Boolean, integer, floating-point numbers, scientific notation, strings
  • bitwise operators: ~ & ^ | « »
  • formatting print() output with end= and sep= arguments
  • building loops: while, for, range(), in, iterating through sequences
  • assignments and shortcut operators
  • expanding loops: while-else, for-else, nesting loops, and conditional statements
  • basic concepts: interpreting and the interpreter, compilation and the compiler, language elements, lexis, syntax and semantics, Python keywords, instructions, indenting

2. Data Aggregates (25%)

Objectives covered by this section:

  • tuples vs. lists: similarities and differences, lists inside tuples and tuples inside lists
  • 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
  • lists in lists: matrices and cubes
  • 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
  • tuples: indexing, slicing, building, immutability
  • 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

3. Functions and Modules (25%)

Objectives covered by this section:

  • return and yield keywords, returning results, the None keyword, recursion
  • converting generator objects into lists using the list() function
  • lambda functions, defining and using
  • pyc file creation and usage
  • Python hashbangs, using multiline strings as module documentation
  • name scopes, name hiding (shadowing), the global keyword
  • import directives, qualifying entities with module names, initializing modules
  • defining and invoking your functions and generators
  • constructing and distributing packages, packages vs. directories, the role of the init.py file
  • the if operator
  • hiding module entities
  • map(), filter(), reduce(), reversed(), sorted() functions and the sort() method
  • parameters vs. arguments, positional keyword and mixed argument passing, default parameter values
  • writing and using modules, the name variable

4. Classes, Objects, and Exceptions (25%)

Objectives covered by this section:

  • single inheritance vs. multiple inheritances
  • hasattr(), type(), issubclass(), isinstance(), super() functions
  • assertions
  • writing and using constructors
  • exceptions hierarchy, assigning more than one exception to one except branch
  • invoking methods, passing and using the self-argument/parameter
  • introspection: dict, name, module, bases properties, examining class/object structure
  • inheritance and overriding, finding class/object components
  • the role of the str method
  • the init method
  • adding your exceptions to an existing hierarchy
  • using predefined exceptions and defining your ones
  • class methods: defining and using the self-parameter meaning and usage
  • name mangling
  • 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
  • the anatomy of an exception object
  • read(), readinto(), readline(), write(), close() methods
  • defining your classes, superclasses, subclasses, inheritance, searching for missing class components, creating objects
  • the try-except-else-finally block, the raise statement, the except-as variant
  • class attributes: class variables and instance variables, defining, adding, and removing attributes, explicit constructor invocation

NEW QUESTION 37
What can you deduce from the following statement? (Select two answers)
str = open('file.txt', "rt")

  • A. the opened file cannot be written with the use of the str variable
  • B. str is a string read in from the file named file.txt
  • C. a newlina character translation will be performed during the reads
  • D. if file. txt does not exist, it will be created

Answer: A,B

 

NEW QUESTION 38
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. Import pyfun from pymod
    Pyfun ( )
  • B. From pymod import pyfun
    Pyfun ( )
  • C. Import pymod
    Pymod. Pyfun ( )
  • D. From pymod import '
    Pymod.pyfun ( )

Answer: B,C

 

NEW QUESTION 39
Which of the following snippets will execute without raising any unhandled exceptions? (Select answers) A)

B)

C)

D)

  • A. Option D
  • B. Option A
  • C. Option C
  • D. Option B

Answer: A,C,D

 

NEW QUESTION 40
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. len(ClassB.__bases__) == 1
  • C. ClassA. _module_ == 'ClassA'
  • D. _name == _main_'

Answer: B

 

NEW QUESTION 41
What would you use instead of XXX if you want to check whether a certain ' key' exists in a dictionary called diet? (Select two answers) II if XXX:
print("Key exists")

  • A. diet['key'] != None
  • B. diet.exists('key')
  • C. 'key' in diet.keys()
  • D. 'key' in diet

Answer: A,C

 

NEW QUESTION 42
What is the expected behavior of the following code?

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

Answer: D

 

NEW QUESTION 43
What is the expected behavior of the following code?

  • A. it outputs 2
  • B. it outputs 1
  • C. the code is erroneous and it will not execute
  • D. it outputs 3

Answer: D

 

NEW QUESTION 44
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, 1] ? (Select two answers)

  • A. self .put self.get () [-1])
  • B. put self.store(1])
  • C. self put stire(1])
  • D. self .put (self.store[1])

Answer: C,D

 

NEW QUESTION 45
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. if a real-life object can be described with a set of adjectives, they may reflect a Python object method
  • C. each object of the same class can have a different set of methods
  • D. a subclass is usually more specialized than its superclass

Answer: A,B

 

NEW QUESTION 46
What can you deduce from the following statement0 (Select two answers) str = open('file.txt', "rt")

  • A. str is a string read in from the file named file. txt
  • B. the opened file cannot be written with the use of the str variable
  • C. a newlina character translation will be performed during the reads
  • D. if file. txt does not exist, it will be created

Answer: B,C

 

NEW QUESTION 47
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 pypack.module_a
  • C. import module_a
  • D. from pypack import module_a

Answer: B,D

 

NEW QUESTION 48
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. 'var1 in Class, diet
  • C. 'var' in Object.__diet__
  • D. len(Object.__diet__) == 1

Answer: D

 

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

  • A. it outputs list assignment index out of range
  • B. it outputs error
  • C. the code is erroneous and it will not execute
  • D. it outputs <class ' IndexError' >

Answer: A

 

NEW QUESTION 50
What is the output of the following piece of code?

  • A. ant bat came1
  • B. antbatcame1
  • C. ant'bat'came1
  • D. ant"bat"came1

Answer: D

Explanation:

 

NEW QUESTION 51
Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Choose two.)

  • A. isinstance (obj_b,A)
  • B. A.VarA == 1
  • C. B.VarA == 1
  • D. obj_a is obj_aa

Answer: A,D

 

NEW QUESTION 52
An operator able to perform bitwise shifts is coded as (select two answers)

  • A. ++
  • B. >>
  • C. - -
  • D. <<

Answer: B,D

 

NEW QUESTION 53
What is true about Python packages? (Select two answers)

  • A. the sys.path variable is a list of strings
  • B. a code designed to initialize a package's state should be placed inside a file named init.py
  • C. a package contents can be stored and distributed as an mp3 file
  • D. _pycache_is a folder that stores semi-completed Python modules

Answer: B,D

 

NEW QUESTION 54
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.queue[+1]
  • B. queue.append(self.get last () + 1)
  • C. self.queue.append(self.get last() +1)
  • D. self.queue.append(get_Iast() + 1)

Answer: C

 

NEW QUESTION 55
Which of the following statement are true? (Select two answers)

  • A. the second open ( ) argument describes the open mode and defaults to 'w'
  • B. closing an open file is performed by the closefile ( ) function
  • C. if open ( ) 's second argument is 'r' the file must exist or open will fail
  • D. if open ( )'s second argument is 'w' and the invocation succeeds, the previous file's content is lost

Answer: C,D

 

NEW QUESTION 56
The simplest possible class definition in Python can be expressed as:

  • A. class X:
    pass
  • B. class X:
    return
  • C. class X:
  • D. class X: {}

Answer: C

 

NEW QUESTION 57
What is the expected behavior of the following code?

  • A. it outputs 3
  • B. it raises an exception
  • C. it outputs 'None'
  • D. it outputs 0

Answer: D

 

NEW QUESTION 58
......

Powerful PCAP-31-03 PDF Dumps for PCAP-31-03 Questions: https://www.prepawaytest.com/Python-Institute/PCAP-31-03-practice-exam-dumps.html

2021 Realistic PCAP-31-03 Dumps Exam Tips Test Pdf Exam Material: https://drive.google.com/open?id=13GSgTA9Qdh6Hx1smotAfjBA3PIod7Jay 

Contact Us

If you have any question please leave me your email address, we will reply and send email to you in 12 hours.

Our Working Time: ( GMT 0:00-15:00 )
From Monday to Saturday

Support: Contact now