Sample questions
Python Institute Certified Professional in Python Programming 1 (PCPP1, PCPP-32-101) (PCPP1) practice questions
What is the primary function of the 'bg' parameter in a widget configuration?
You are debugging a legacy application and need to ensure that resources like file handles are always closed. Which construct is preferred?
You are writing a library that expects a custom exception. Which practice aligns best with Python's exception handling hierarchy?
Which TWO of the following are valid conventions for naming in Python according to PEP 8?
What is the correct way to specify the title of a Tkinter window?
In a team environment, which PEP 8 guideline should be applied to maintain consistent indentation when mixing spaces and tabs?
Which THREE practices are recommended when handling external libraries?
Which THREE elements are essential for a good Python docstring?
Which of the following is the correct way to handle whitespace around an operator according to PEP 8?
Which TWO of the following events are commonly bound in Tkinter for mouse interaction?
You have a list of options and want the user to select one using a dropdown menu. Which widget should you use?
Why should you use super() instead of calling the parent class method directly by name?
A script processes data from untrusted sources. Which technique best mitigates 'pickle' deserialization vulnerabilities?
In the context of writing robust error handling, what is the 'EAFP' principle?
Which TWO of the following methods are commonly used to update a Tkinter widget's state or appearance dynamically?
When creating a new project, how should you structure your imports?
You need to add a label that displays static text in your GUI. Which widget is most appropriate for this purpose?
When using the pack geometry manager, you want a widget to fill the available space in the parent container. Which argument for the 'fill' parameter should you use to make it expan…
You need to ensure your code is readable by other Python developers. Which naming style should be used for variable names?
When documenting a complex function, which approach is most compliant with Google Style Python Docstrings regarding parameter types?
Which TWO of the following statements about the 'grid' geometry manager are correct?
Which module must be imported to utilize Tkinter in a Python script?
Which status code indicates that a requested resource has been successfully created?
You are using the pack() geometry manager and want to place a frame at the bottom of the window, ensuring it stays there even when other widgets are added. Which configuration is c…