how to insert the elements in a list properly?

length power elearn2014 at gmail.com
Wed Apr 9 04:57:25 EDT 2014


word=["x1","x2","x3","x4","x5"]
w=word[-2:]
del word[-2:]
word.insert(2,w)
word
['x1', 'x2', ['x4', 'x5'], 'x3']

what i want to get is
['x1', 'x2', 'x4', 'x5', 'x3']

how can i insert them ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140409/9d45bb74/attachment.html>


More information about the Python-list mailing list