Re: how to construct a list of only one tuple

2008-11-27 Thread MRAB
TP wrote: [EMAIL PROTECTED] wrote: a=("1","2") b=[("3","4"),("5","6")] list(a)+b ['1', '2', ('3', '4'), ('5', '6')] a = ("1", "2") b = [("3", "4"), ("5", "6")] [a] + b [('1', '2'), ('3', '4'), ('5', '6')] Thanks a lot. Why this difference of behavior between list(a) and [a]? list(a) itera

Re: how to construct a list of only one tuple

2008-11-27 Thread Chris Rebert
On Thu, Nov 27, 2008 at 2:39 PM, TP <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >>> >>> a=("1","2") >>> >>> b=[("3","4"),("5","6")] >>> >>> list(a)+b >>> ['1', '2', ('3', '4'), ('5', '6')] >> > a = ("1", "2") > b = [("3", "4"), ("5", "6")] > [a] + b >> [('1', '2'), ('3', '4'

Re: how to construct a list of only one tuple

2008-11-27 Thread Diez B. Roggisch
TP schrieb: [EMAIL PROTECTED] wrote: a=("1","2") b=[("3","4"),("5","6")] list(a)+b ['1', '2', ('3', '4'), ('5', '6')] a = ("1", "2") b = [("3", "4"), ("5", "6")] [a] + b [('1', '2'), ('3', '4'), ('5', '6')] Thanks a lot. Why this difference of behavior between list(a) and [a]? Because th

Re: how to construct a list of only one tuple

2008-11-27 Thread TP
[EMAIL PROTECTED] wrote: >> >>> a=("1","2") >> >>> b=[("3","4"),("5","6")] >> >>> list(a)+b >> ['1', '2', ('3', '4'), ('5', '6')] > a = ("1", "2") b = [("3", "4"), ("5", "6")] [a] + b > [('1', '2'), ('3', '4'), ('5', '6')] Thanks a lot. Why this difference of behavior between list

Re: how to construct a list of only one tuple

2008-11-27 Thread bearophileHUGS
TP: > >>> a=("1","2") > >>> b=[("3","4"),("5","6")] > >>> list(a)+b > ['1', '2', ('3', '4'), ('5', '6')] >>> a = ("1", "2") >>> b = [("3", "4"), ("5", "6")] >>> [a] + b [('1', '2'), ('3', '4'), ('5', '6')] Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list