What is printed? python a = [10, 20, 30, 40] print(a[1:3])

  1. [20, 30]
  2. [10, 20]
  3. [10, 20, 30]
  4. [20, 30, 40]
Answer

A) [20, 30]

Slicing includes the start index and excludes the stop index. SLO CS-11-C-05

Computer Science MCQ · More Unit 3: Programming Fundamentals MCQs · Practise