Report Bug

Qus

What will be the output of the following Python code?

a=[13,56,17]
a.append([87])
a.extend([45,67])
print(a)

Qus

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

a=[13,56,17]
a.append([87])
a.extend([45,67])
print(a)


A. [13, 56, 17, [87], 45, 67]
B. [13, 56, 17, 87, 45, 67]
C. [13, 56, 17, 87,[ 45, 67]]
D. [13, 56, 17, [87], [45, 67]]


Solution
A. [13, 56, 17, [87], 45, 67]



Explanation
The append function simply adds its arguments to the list as it is while extend function extends its arguments and later appends it.
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad