Python: Appending Multiple Items to a List
Jan 20, 2008The extend()
method can be used to append multiple items to the end of a list. Executing the following statements
produces as output
[0, 1, 2, 3, 4, 5, 6 ]
The extend()
method takes a single argument which must be list object. The entire contents of the argument is appended to the end of the list for which the method was invoked.
reference:
Python for Java Programmers