nerdexam
Python_Institute

PCEP-30-02 · Question #323

What is the expected output of the following code? Print(len([i for i in range(0, -2)]))

The correct answer is D. 0. See the full explanation below for the reasoning.

Question

What is the expected output of the following code? Print(len([i for i in range(0, -2)]))

Options

  • A1
  • B3
  • C2
  • D0

How the community answered

(34 responses)
  • A
    12% (4)
  • B
    6% (2)
  • C
    3% (1)
  • D
    79% (27)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice