can we append a list with another list in Python ?

inshu chauhan insideshoes at gmail.com
Thu Oct 25 05:51:01 EDT 2012


> 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:
> ...     list_1.append(i)
> ...
> >>> list_1
> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>
>
> or would another example help you out more?
>

No but really sorry this is what I DONT WANT.......

The output I want to have is :

[ [0, 1, 2, 3, 4 ], [5, 6, 7, 8, 9, 10] ].....

>
> --
> Best Regards,
> David Hutto
> CEO: http://www.hitwebdevelopment.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20121025/da2955a0/attachment.html>


More information about the Python-list mailing list