Dec 14, 2019 in Python
Q: What Is Slicing In Python?

1 Answer

Dec 14, 2019

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

Click here to read more about Python
Click here to read more about Insurance

Related questions

May 2 in Image processing
Aug 30 in Python
Aug 30 in Python