What happens? python cities = ['Islamabad', 'Karachi', 'Lahore'] print(cities[3])

  1. Islamabad
  2. IndexError
  3. Lahore
  4. None
Answer

B) IndexError

Indexes are 0, 1, 2 — index 3 is out of range. cities[-1] or cities[2] gives Lahore. SLO CS-11-C-05 · Application

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