Free PCPP1 Mock Exam – Practice Online Confidently

Increase your chances of passing the Python Institute PCPP1 exam questions on your first try. Practice with our free online PCPP1 exam mock test designed to help you prepare effectively and confidently.

Exam Code: PCPP1
Exam Questions: 564
Certified Professional in Python Programming 1
Updated: 24 Nov, 2026
Question 1

You are developing a Python project and want to follow the PEP 8 guidelines for using comments effectively. Which of the following scenarios demonstrates the correct usage of block comments and inline comments according to PEP 8?

Options :
Answer: E

Question 2

Suppose you have the following code:
class ClientList(list):
    def search_email(self, value):
        result = [client for client in self if value in client.email]
        return result
 
class Client:
    all_clients = ClientList()
 
    def __init__(self, name, email):
        self.name = name
        self.email = email
        Client.all_clients.append(self)
Select all true statements. (select 2)

Options :
Answer: B,C

Question 3

The logging.basicConfig function can be used to change the default log formatting. This is done using the format argument, which can be defined using any characters or attributes of the LogRecord object. What formatting should you apply to get the following?2024-02-08 16:35:27,164 krako WARNING:Your log message

Options :
Answer: A

Question 4

What is the result of the following code?

f = Figure()

print(f.area())

Options :
Answer: B

Question 5

In Python, there is a handy module, called shelve, that is built on top of pickle, and implements a serialization dictionary where objects are pickled and associated with a key. Therefore, you can open your shelved data file and access your pickled objects via the keys the way you do when you access Python dictionaries. For example:import shelve my_shelve = shelve.open('my_shelve.shlv', flag='c')The flag parameter in the shelve.open() function specifies the mode in which the shelve database should be opened. The default values of the optional flag parameter is set to 'c'. This parameter can accept values like 'r', 'w', 'c' or 'n'. Select the answer that correctly describes these values.

Options :
Answer: C

Viewing Page : 1 - 57
Practicing : 1 - 5 of 564 Questions

© Copyrights FreeMockExams 2026. All Rights Reserved

We use cookies to ensure that we give you the best experience on our website (FreeMockExams). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the FreeMockExams.