Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: can we append a list with another list in Python ? (http://www.velocityreviews.com/forums/t953766-re-can-we-append-a-list-with-another-list-in-python.html)

Daniel Fetchinson 10-23-2012 08:51 AM

Re: can we append a list with another list in Python ?
 
> can we append a list with another list in Python ? using the normal routine
> syntax but with a for loop ??


x = [1,2,3]
y = [10,20,30]
x.extend( y )
print x

this will give you [1,2,3,10,20,30] which I guess is what you want.

Cheers,
Daniel



--
Psss, psss, put it down! - http://www.cafepress.com/putitdown


All times are GMT. The time now is 05:38 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.