CBSE Class 11 Computer Science Question 5 of 82

Lists in Python — Question 5

Back to all questions
5
Question

Question 5

Assertion (A): The position of each element in the list is considered as its index.

Reasoning (R): Indexing in a list can be positive and negative; index is defined using [] brackets.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.
Answer

Both A and R are true and R is the correct explanation of A.

Explanation
In Python, an index is a number specifying the position of an element in a list. Indexing in a list can be positive and negative. Positive indexing starts from 0 for the first element, while negative indexing starts from -1 for the last element. Indexing is defined using square brackets ([]).