nerdexam
Python_Institute

PCEP-30-02 · Question #367

What is the expected output of the following code? data = ['Peter', 404, 3.03, 'Wellert', 33.3] print(data[1:3])

The correct answer is C. [404, 3.03]. See the full explanation below for the reasoning.

Question

What is the expected output of the following code? data = ['Peter', 404, 3.03, 'Wellert', 33.3] print(data[1:3])

Options

  • A['Peter', 404, 3.03, 'Wellert', 33.3]
  • BNone of the above.
  • C[404, 3.03]
  • D['Peter', 'Wellert']

How the community answered

(50 responses)
  • A
    18% (9)
  • B
    8% (4)
  • C
    70% (35)
  • D
    4% (2)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice