Q. What will be the output of the following code snippet?


Lst = [1, 2, 3, 4, 5, 6, 7, 8, 9]

Lst[::2] = 10, 20, 30, 40, 50, 60

print (Lst)


(a) ValueError: attempt to assign sequence of size 6 to extended slice of size 5
(b) [10, 2, 20, 4, 30, 6, 40, 8, 50, 60]
(c) [1, 2, 10, 20, 30, 40, 50, 60]
(d) [1, 10, 3, 20, 5, 30, 7, 40, 9, 50, 60]

Answer :-

Option (a)

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post