KnowledgeBoat Logo
|

Informatics Practices

Assertion (A): List traversal in Python is done through slicing and using for loop also.

Reasoning (R): Traversal can be done only through forward indexing.

  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

A is true but R is false.

Explanation
List traversal in Python can be done using slicing and a for loop. Both methods allow to access and iterate over elements in a list. Traversal in Python lists can be done through both forward and backward indexing.

Answered By

1 Like


Related Questions