x = [1, 2, 3, 4] x[1:3] = [22, 33, 44] # x is now [1, 22, 33, 44, 4] print x x[1:4] = [8, 9] # x is now [1, 8, 9, 4] print x