Open this example in the interactive library
Source code
values = [1, 2, 3, 4]
values[::2] = [10, 30]
print(values)Sample output
[10, 2, 30, 4]

Open this example in the interactive library
values = [1, 2, 3, 4]
values[::2] = [10, 30]
print(values)[10, 2, 30, 4]