can we append a list with another list in Python ?
dwightdhutto at gmail.com
Thu Oct 25 11:47:50 CEST 2012
On Thu, Oct 25, 2012 at 5:31 AM, Dave Angel <d at davea.name> wrote:
> On 10/25/2012 05:21 AM, inshu chauhan wrote:
>>> or if the clist initial contents were relevant, perhaps you mean
>>>> clist += alist, blist
>> But not this because it will simply concatenate the list like
>> [1,2,3,4,5,6] .. I dont want this actaully...
> No, it won't. Try it to see.
Is this what you mean:
>>> list_1 = [i for i in range(0,5)]
>>> list_2 = [i for i in range(5,11)]
>>> for i in list_2:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
or would another example help you out more?
More information about the Python-list