Informatics Practices

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.

Python List Manipulation

3 Likes

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 ([]).

Answered By

2 Likes


Related Questions