I am new to Python, could someone please tell me the difference between the output of these two blocks of code:
1.
>> example = [1, 32, 1, 2, 34]
>> example[4:0] = [122]
>> example
[1, 32, 1, 2, 122, 34]
2.
>> example = [1, 32, 1, 2, 34]
>> example[4:1] = [122]
>> example
[1, 32, 1, 2, 122, 34]
example[4:0]return? What aboutexample[4:1]? Andexample[4:5]? Try to understand how the slicing works first, then you can deduce why your assignments do the same thing.