Question #101

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

The extend() function adds [4, 5] as a whole to the iterable [1, 2, 3] e.g. [1, 2, 3,[4,5]] . In return, 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] . (stackoverflow.com/questions/252703/what-is-the-difference...)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: