Re: can we append a list with another list in Python ?

Discussion in 'Python' started by Daniel Fetchinson, Oct 23, 2012.

  1. > 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
    Daniel Fetchinson, Oct 23, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. June Moore

    Append one array to another array

    June Moore, Oct 28, 2004, in forum: Java
    Replies:
    20
    Views:
    67,991
    HeidelbergMan
    Jul 6, 2007
  2. HYRY
    Replies:
    10
    Views:
    585
    Bruno Desthuilliers
    Sep 26, 2007
  3. dhruvbird
    Replies:
    16
    Views:
    1,329
    John Nagle
    Jul 16, 2010
  4. Dave Angel
    Replies:
    0
    Views:
    168
    Dave Angel
    Oct 25, 2012
  5. David Hutto
    Replies:
    0
    Views:
    161
    David Hutto
    Oct 25, 2012
Loading...

Share This Page