MCQ Answer

What happens if you attempt to access an index that is out of range in a list?

What happens if you attempt to access an index that is out of range in a list?

यदि आप किसी ऐसे इंडेक्स तक पहुँचने का प्रयास करते हैं जो किसी लिस्ट के रेंज से बाहर है तो क्या होगा?
Topic : Sequence data types in python

A. It returns None. यह कोई नहीं रिटर्न करता है।

B. It raises an IndexError यह एक IndexError उत्पन्न करता है

C. It creates a new element at that index. यह उस इंडेक्स पर एक नया एलिमेंट्स क्रिएट करता है।

D. It returns an empty list. यह एक एम्प्टी लिस्ट रिटर्न करता है।




Correct Answer is :

B. It raises an IndexError



Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad