Free PCPP-32-101 Sample Questions — Certified Professional in Python Programming 1

Free PCPP-32-101 sample questions for the Certified Professional in Python Programming 1 exam. No account required: study at your own pace.

Want an interactive quiz? Take the full PCPP-32-101 practice test

Looking for more? Click here to get the full PDF with 27+ practice questions for $4 for offline study and deeper preparation.

Question 1

What is a static method?

  • A. method that works on the class itself
  • B. method decorated with the @method trait
  • C. method that requires no parameters referring to the class itself
  • D. method that works on class objects that are instantiated
Show Answer
Correct Answer:
C. method that requires no parameters referring to the class itself
Question 2

Select the true statements related to PEP 8 programming recommendations for code writing. (Choose two.)

  • A. You should use the not ... is operator (e.g. if not spam is None:), rather than the is not operator (e.g. if spam is not None:), to increase readability
  • B. You should make object type comparisons using the isinstance() method (e.g. if isinstance(obj , int):) instead of comparing types directly (e.g. if type(obj) is type(1))
  • C. You should write code in a way that favors the CPython implementation over PyPy, Cython, and Jython
  • D. You should not write string literals that rely on significant trailing whitespaces, as they may be visually indistinguishable, and certain editors may trim them
Show Answer
Correct Answer:
  • B. You should make object type comparisons using the isinstance() method (e.g. if isinstance(obj , int):) instead of comparing types directly (e.g. if type(obj) is type(1))
  • D. You should not write string literals that rely on significant trailing whitespaces, as they may be visually indistinguishable, and certain editors may trim them
Question 3

Which of the following values can be returned by the messagebox.askquestion() method?

  • A. "accept" and "cancel"
  • B. l and 0
  • C. "yes" and "no"
  • D. True and False
Show Answer
Correct Answer:
C. "yes" and "no"
Question 4

In the JSON processing context, the term serialization:

  • A. names a process in which Python data is turned into a JSON string
  • B. names a process in which a JSON string is turned into Python data
  • C. refers to nothing, because there is no such thing as JSON serialization
  • D. names a process in which a JSON string is remodeled and transformed into a new JSON string
Show Answer
Correct Answer:
A. names a process in which Python data is turned into a JSON string
Question 5

Select the true statement related to PEP 257.

  • A. String literals that occur immediately after another docstring are called attribute docstrings
  • B. Attribute docstrings and Additional docstrings are two types of extra docstrings that can be extracted by software tools
  • C. String literals that occur in places other than the first statement in a module, function, or class definition can act as documentation. They are recognized by the Python bytecode compiler, and are accessible as runtime object attributes
  • D. String literals that occur immediately after a simple assignment at the top level of a module are called complementary docstrings
Show Answer
Correct Answer:
B. Attribute docstrings and Additional docstrings are two types of extra docstrings that can be extracted by software tools

Aced these? Get the Full Exam

Download the complete PCPP-32-101 study bundle with 27+ questions in a single printable PDF.