Report Bug

Qus

What will be the output of the following code snippet?

a=[1,2,3,4,5,6,7,8,9]
a[::2]=10,20,30,40,50,60
print(a)
Qus

निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?

a=[1,2,3,4,5,6,7,8,9]
a[::2]=10,20,30,40,50,60
print(a)


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]


Solution
A. ValueError: attempt to assign sequence of size 6 to extended slice of size 5



Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad