🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Python Lists: all 15 questions

Quiz: Python Lists · Question 9 of 15

What does this print? (code)

What does this print?

x = [1, 2, 3]
x.insert(0, 9)
print(x[0], x[-1])
  1. A.9 3
  2. B.1 9
  3. C.9 9
  4. D.1 3
Answer & explanation

Correct answer: 9 3

9 goes to the front.

Can you get the rest right without peeking?

Take the timed Quiz: Python Lists quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →