Run
string1 = 'hello-world' start = 2 #start position of slice in string stop = 5 #end position of slice in string slice_object = slice(start, stop) result = string1[slice_object] print(result)
Output