nerdexam
Python_Institute

PCEP-30-02 · Question #325

How many stars will the following snippet print to the monitor? data = [[x for x in range(y)] for y in range(3)] for d in data: if len(d) < 2: print('*')

The correct answer is C. two. See the full explanation below for the reasoning.

Question

How many stars will the following snippet print to the monitor? data = [[x for x in range(y)] for y in range(3)] for d in data: if len(d) < 2: print('*')

Options

  • Athree
  • Bzero
  • Ctwo
  • Done

How the community answered

(33 responses)
  • A
    6% (2)
  • B
    3% (1)
  • C
    76% (25)
  • D
    15% (5)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice