List -> Tuple
Skip Montanaro
skip at pobox.com
Wed Oct 31 11:36:53 EST 2001
More information about the Python-list mailing list
Wed Oct 31 11:36:53 EST 2001
- Previous message (by thread): List -> Tuple
- Next message (by thread): List -> Tuple
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Joseph> Is there a simple way to convert a list into a tuple, like a
Joseph> built-in function for that? Or is the easiest way to just
Joseph> iterate through the list and append to a tuple?
Try the tuple builtin:
>>> l = [1,2,3]
>>> tuple(l)
(1, 2, 3)
--
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/
- Previous message (by thread): List -> Tuple
- Next message (by thread): List -> Tuple
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list