0 votes
in Python Flask by
What is slicing?

1 Answer

0 votes
by
Slicing is a technique that allows us to retrieve only a part of a list, tuple, or string. For this, we use the slicing operator [].

>>> (1,2,3,4,5)[2:4]
(3, 4)

>>> [7,6,8,5,9][2:]
[8, 5, 9]

>>> 'Hello'[:-1]
‘Hell’

Related questions

0 votes
asked May 30, 2020 in JAVA by Robindeniel
0 votes
asked Sep 2, 2019 in 5G Network by Venkatshastri
...