Questenaتمرینی که نشان می‌دهد بعد چه چیزی را مرور کنید
سؤال 91

Given items = [10, 20], which exception type results from items[4]?

  1. KeyError
  2. ValueError
  3. IndexErrorپاسخ درست
  4. It returns None

توضیح

Index 4 lies outside the valid positions of this two-item list, so direct subscription raises IndexError. Slices can clip excessive bounds, but this expression is a single index rather than a slice.

ادامهٔ این آزمون

شروع تمرین
سؤال 91: Given items = [10, 20], which exception type results from… · Python Fundamentals · Questena