Change with steps
examples/lists/change_steps.py
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] print(numbers) # [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] print(numbers[1::2]) # [2, 4, 6, 8, 10, 12] numbers[1::2] = [0, 0, 0, 0, 0, 0] print(numbers) # [1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0] numbers[1::2] = [42] * 6 print(numbers) # [1, 42, 3, 42, 5, 42, 7, 42, 9, 42, 11, 42]