468,267 Members | 1,828 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,267 developers. It's quick & easy.

Tuple to list?


How do you convert a tuple to a list?
Thanks in advance.

---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
Jul 18 '05 #1
2 106292
In message <ma************************************@python.org >
Evan Patterson <he*****************@yahoo.com> wrote:
How do you convert a tuple to a list?


a=(1,2,3)
b=list(a)
b
[1, 2, 3]

--
___
|im ---- ARM Powered ----
Jul 18 '05 #2
Evan Patterson fed this fish to the penguins on Saturday 15 November
2003 09:11 am:

How do you convert a tuple to a list?
<sigh>

[wulfraed@beastie wulfraed]$ python
Python 2.2 (#1, Nov 5 2002, 15:43:24)
[GCC 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)] on linux-i386
Type "help", "copyright", "credits" or "license" for more information.
tup = ('a one', 'an a two', 'and some bubbles')
lst = list(tup)
lst ['a one', 'an a two', 'and some bubbles']


Did you bother looking at the python documentation at all?

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Bestiaria Home Page: http://www.beastie.dm.net/ <
Home Page: http://www.dm.net/~wulfraed/ <


Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Carlo v. Dango | last post: by
10 posts views Thread by Stefan Seefeld | last post: by
16 posts views Thread by flyaflya | last post: by
3 posts views Thread by Carl J. Van Arsdall | last post: by
43 posts views Thread by Tim Chase | last post: by
3 posts views Thread by Mirco Wahab | last post: by
77 posts views Thread by Nick Maclaren | last post: by
3 posts views Thread by Davy | last post: by
3 posts views Thread by Daniel | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.