Question #100

Which code snippet will return [1, 2, 3, 4, 5]?

The function append() appends an object at the end of a list. Here, the individual elements of [4, 5] e.g. 4 and 5 are appended to [1, 2, 3] . In return, the extend() function adds [4, 5] as a whole to the iterable [1, 2, 3] e.g. [1, 2, 3,[4,5]] . (stackoverflow.com/questions/252703/what-is-the-difference...)


Comment on Disqus:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: