← 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])
- A.9 3
- B.1 9
- C.9 9
- 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 →