Free PCEP-30-02 sample questions
Real questions from the Pcep – Certified Entry-Level Python Programmer practice bank, with the correct answer and an explanation for each one. No junk, no filler.
Try them in the simulator Same questions, with study, timed and flashcard modes.
Showing 10 of 20 free sample questions.
A programmer creates a tuple containing a list. They then attempt to modify an element within that list. What is the outcome of this operation? ```python data_tuple = (1, 2, [3, 4]) data_tuple[2][0] = 99 print(data_tuple) ```
A developer needs to create a function `calculate_price` that accepts a base price and an optional discount percentage. If the discount is not provided, it should default to 10%. Which function signature correctly implements this requirement?
A data processing script needs to create a new list containing only the lengths of strings from an existing list, but only for strings that have more than 3 characters. Which of the following is the most 'Pythonic' way to achieve this using a single line of code? `words = ['cat', 'window', 'defenestrate', 'dog']`
True or False: In Python, the expression `0.1 + 0.2 == 0.3` evaluates to `True`.
A developer is writing a validation function that checks if a user's input is within a specific numerical range (inclusive). The function should return `True` if the number is between 50 and 100, inclusive. Which boolean expression correctly and most concisely implements this logic?
A script needs to iterate through a sequence of numbers from 0 to 9. During the iteration, it should print 'Found it!' and stop processing immediately when it encounters the number 7. For all other numbers before 7, it should just print the number itself. What is the expected output of a correctly written loop for this task?
A Python dictionary is used to store user preferences. A function needs to retrieve the 'theme' preference. If the 'theme' key does not exist, the function should return 'light' without causing an error and without modifying the original dictionary. Which line of code achieves this safely?
A junior developer is trying to understand variable scope in Python. They have written the following code. What will be the output when this script is executed? ```python value = 100 def my_func(): value = 50 print(f"Inside function: {value}") my_func() print(f"Outside function: {value}") ```
A programmer needs to combine two lists into a single list. Which of the following methods will create a new list containing all elements from `list1` followed by all elements from `list2`, without modifying the original lists? (Select TWO)
10 more free samples are waiting
Create a free account to unlock the whole PCEP-30-02 sample bank, or get full access to all 192 practice questions in the simulator.