On 01/10/2017 10:31 PM, ramakrishna reddy wrote:
Hi All,
Is there any way to convert x = (1, 2, 3, (4, 5)) to x = (1, 2, 3, 4, 5) in
python 2.7
Almost:
# /usr/bin/env python
Python 2.7.3 (default, Sep 22 2012, 02:37:18)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import itertools
>>> a = list(itertools.chain((1,2,3),(4,5)))
>>> a
[1, 2, 3, 4, 5]
Emile
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor