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