In a python program, define a list: my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
The output results of executing the following two statements are different:
1:
list1 = my_list[1:9:2]
print(list1)
output:[2, 4, 6, 8]
2:
list2 = my_list[1::2]
print(list2)
output:[2, 4, 6, 8, 10]
I can't understand why there is no "10" in the output of the first statement