KnowledgeBoat Logo

Class - 12 CBSE Computer Science — Assertion Reason Type Questions

Assertion (A): Indexing refers to accessing elements of a sequence. Python offers two types of indexing, viz. positive or forward and negative or backward indexing.

Reasoning (R): Both forward and backward indexing are implemented in all the sequences, which start with first (1st) index.

  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 Data Handling

1 Like

Answer

A is true but R is false.

Explanation
Indexing in Python refers to accessing elements of a sequence, such as strings, lists, tuples, etc. Python supports two types of indexing: positive (forward) indexing and negative (backward) indexing. In Python, indexing starts from 0, not from the first index (1st index). Forward indexing starts from the first element with an index of 0, while backward indexing starts from the last element with an index of -1.

Answered By

1 Like