PCEP – Certified Entry-Level Python Programmer

Here you have the best Python Institute PCEP-30-02 practice exam questions

  • You have 331 total questions to study from
  • Each page has 5 questions, making a total of 67 pages
  • You can navigate through the pages using the buttons at the bottom
  • This questions were last updated on May 15, 2025
  • This site is not affiliated with or endorsed by Python Institute.
Question 1 of 331

Insert the correct snippet so that the program produces the expected output.

Expected output:

Code:

    Correct Answer: C

    To get the output as True, we need to evaluate the given list with a condition that results in True. The correct answer is to check if 0 is in the list. In Python, the boolean value False is equivalent to 0. Therefore, the expression '0 in list' will return True because False is present in the list. The correct snippet is 'b = 0 in list'.

Question 2 of 331

Assuming that the tuple is a correctly created tuple, the fact that tuples are immutable means that the following instruction:

    Correct Answer: A

    Tuples in Python are immutable, which means their elements cannot be changed once they are created. Any operation that tries to modify the contents of a tuple, such as assigning a new value to an element of a tuple, will result in a TypeError. Therefore, the statement 'my_tuple[1] = my_tuple[1] + my_tuple[0]' is illegal because it attempts to change an element of the tuple.

Question 3 of 331

What is the expected output of the following code?

    Correct Answer: B

Question 4 of 331

What is the expected output of the following code?

    Correct Answer: C

    When the code executes, list1 and list2 both refer to the same list object in memory. Therefore, any modification to list1 will also reflect in list2. When list1[0] is assigned the value 4, the change is also reflected in list2. As a result, printing list2 will output [4, 3].

Question 5 of 331

What is the expected output of the following code?

    Correct Answer: C

    The print(data[1:3]) statement uses list slicing to extract a sublist from the data list. In Python, list slicing is done using the syntax list[start:stop], where 'start' is the index where the slice begins (inclusive) and 'stop' is the index where the slice ends (exclusive). For the given list data: ['Peter', 404, 3.03, 'Wellert', 33.3], the slice data[1:3] will include the elements at indices 1 and 2, which are 404 and 3.03, respectively. Therefore, the expected output is [404, 3.03].