Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Define slicing in Python?
Answer:

Slicing is a procedure used to select a particular range of items from sequence types such as Strings, lists, and so on.

a = ("a", "b", "c", "d", "e", "f", "g", "h")

x = slice(3, 5)

print(a[x])

Output:

('d', 'e')

Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook