CBSE Class 11 Informatics Practices Question 3 of 80

Lists in Python — Question 3

Back to all questions
3
Question

Question 3

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.
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.