0 votes
in Python by
What Is Slicing In Python?

1 Answer

0 votes
by

Slicing is a string operation for extracting a part of the string, or some part of a list. In Python, a string (say text) begins at index 0, and the nth character stores at position text[n-1]. Python can also perform reverse indexing, i.e., in the backward direction, with the help of negative numbers. In Python, the slice() is also a constructor function which generates a slice object. The result is a set of indices mentioned by range(start, stop, step). The slice() method allows three parameters. 1. start – starting number for the slicing to begin. 2. stop – the number which indicates the end of slicing. 3. step – the value to increment after each index (default = 1).

Related questions

+1 vote
asked Jan 30, 2022 in Python by sharadyadav1986
+1 vote
asked Jan 30, 2022 in Python by sharadyadav1986
...