CBSE Class 11 Computer Science Question 62 of 104

List Manipulation — Question 15

Back to all questions
15
Question

Question 15

What is the difference between appending a list and extending a list?

Answer

Appending a listExtending a list
For appending to a list, append() function is used.For extending a list, extend() function is used.
The append() function can add a single element to the end of a list.The extend() function can add multiple elements from a list supplied to it as argument.
After append(), the length of the list will increase by 1 element only.After extend() the length of the list will increase by the length of the list given as argument to extend()
Answer