Question

The built-in Python function slice allows the programmer to select portions of the input that they want to slice out. it has two possible syntaxes, slice(stop) or slice(start, stop, step). In the single parameter version, start and step default to none. The following code will print "Stir".

String = 'String slicing'
s1 = slice(3)
print(String[s1])

1.s1 = slice(2, 6, 2)

2.s1 = slice(1, 5, 2)

3.s1 = slice(2, 6)

4.s1 = slice(1, 5)

Answers

There are no human answers yet.
Answered by GPT 3.5
The correct answer is:

3. s1 = slice(2, 6)

Related Questions