/* */

Tuesday, 22 March 2011

Extend

append several items at once:

a = [1,2,3]
b = [4,5,6]
a.extend(b)
a
[1,2,3,4,5,6]

This is similar to concatenation except the variable 'a' is modified. In concatenation, the result would create a new variable.

No comments:

Post a Comment