nerdexam
Python_Institute

PCAP-31-03 · Question #118

What is the expected behavior of the following code?

The correct answer is C. it outputs [3, 1]. See the full explanation below for the reasoning.

Question

What is the expected behavior of the following code?

Options

  • Ait outputs [1, 3]
  • Bthe code is erroneous and it will not execute
  • Cit outputs [3, 1]
  • Dit outputs [4, 2, 0]

How the community answered

(46 responses)
  • A
    2% (1)
  • B
    4% (2)
  • C
    85% (39)
  • D
    9% (4)

Community Discussion

No community discussion yet for this question.

Full PCAP-31-03 Practice