CBSE Class 11 Informatics Practices Question 9 of 80

Lists in Python — Question 9

Back to all questions
9
Question

Question 9

Assertion (A): List slices are the sub-part of a list extracted out.

Reasoning (R): In Python, Slice operator[:] is used to select a range of elements from a sequence.

  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

Both A and R are true and R is the correct explanation of A.

Explanation
List slices are the sub-parts of a list extracted out. In Python, Slice operator[:] is used to select a range of elements from a sequence. The syntax used for slicing is: list[start:stop:step].