← Quiz: Python Lists: all 15 questions
Quiz: Python Lists · Question 6 of 15
What does this print? (code)
What does this print?
a = [1, 2, 3]
b = a
b.append(4)
print(len(a))
- A.3
- B.4
- C.An error
- D.1
Answer & explanation
Correct answer: 4
a and b are the same list object.
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 →