num = [1,2,3,4,5] res = num[slice(1, len(num)-1, 2)] print(res)
num = [1,2,3,4,5] res = num[slice(0, len(num), 2)] print(res) #[1, 3, 5]
lst = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] indices = [0, 2, 6] out = [lst[i] for i in indices]