nerdexam
Python_Institute

PCEP-30-02 · Question #382

Assuming that the following assignment has been successfully executed: ``python the_list = ["1", 1, 1.] `` Which of the following expressions evaluate to True? (Select two expressions.)

The correct answer is C. len(the_list[0:2]) < 3 D. the_list.index("1") == 0. See the full explanation below for the reasoning.

Question

Assuming that the following assignment has been successfully executed:
the_list = ["1", 1, 1.]
Which of the following expressions evaluate to True? (Select two expressions.)

Options

  • Athe_list.index("1") in the_list
  • B1.1 in the_list[1:3]
  • Clen(the_list[0:2]) < 3
  • Dthe_list.index("1") == 0

How the community answered

(32 responses)
  • A
    6% (2)
  • B
    16% (5)
  • C
    78% (25)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice