NIELIT O Level Exam

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?

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

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



Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad