What is the syntax of slicing the list?

12. What is the syntax of slicing the list?

  1. List (start index, stop index, step)
  2. List (start index: stop index: step)
  3. List [start index, stop index, step]
  4. List [Start index: stop index: step]

Answer: D) List [Start index: stop index: step]

Explanation:

Slicing in python list is used to divide the list according to the start and last index and to do that following syntax is followed: - List [Start index: stop index: step].

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.