KnowledgeBoat Logo
|

Informatics Practices

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.

Python List Manipulation

1 Like

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

Answered By

3 Likes


Related Questions