+1 vote
in Class 12 by kratos

What does “slice” do?

1 Answer

+2 votes
by kratos
 
Best answer

The slice[n:m] operator extracts subparts from a string. It doesn’t include the character at index m.

(eg) * = “Hello World”

print [0:4] → ***

...