How can I have one element list or tuple?

2007-11-01 Thread nico
The following example returns a string type, but I need a tuple... var = (Hello) print type(var) type 'str' I need that for a method parameter. Thx -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I have one element list or tuple?

2007-11-01 Thread Neil Cerutti
On 2007-11-01, nico [EMAIL PROTECTED] wrote: The following example returns a string type, but I need a tuple... var = (Hello) print type(var) type 'str' I need that for a method parameter. var = hello, -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I have one element list or tuple?

2007-11-01 Thread Steven D'Aprano
On Thu, 01 Nov 2007 09:21:40 -0700, nico wrote: The following example returns a string type, but I need a tuple... var = (Hello) print type(var) type 'str' I need that for a method parameter. Thx It is the comma, not the brackets, that create tuples. The brackets are recommended for