KnowledgeBoat Logo
|

Computer Science

Assertion (A): Indexing in a string is defined as positive and negative indexing.

Reasoning (R): In forward and backward indexing, the indices start with 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 String Manipulation

1 Like

Answer

A is true but R is false.

Explanation
Indexing in a string can be defined as positive and negative indexing. In Python, positive indexing starts from 0 and moves to the right, while negative indexing starts from -1 and moves to the left.

Answered By

3 Likes


Related Questions