Certified Entry-Level Python Programmer (PCEP-30-02) — Question 72

Assuming that the following assignment has been successfully executed:

the_list = [“1”, 1, 1.]

Which of the following expressions evaluate to True? (Choose two.)

Answer options

Correct answer: C, D

Explanation

Option C is correct because slicing the list results in two elements, making the length less than three. Option D is also correct as the index of '1' in the list is indeed 0. Options A and B are incorrect because 1.1 is not in the specified slice and the index of '1' is not an element of the list.