|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
How do you convert a tuple to a list?
Thanks in advance.
__________________
Before you criticize someone, walk a mile in their shoes, that way when you do criticize them, you're a mile away and you have their shoes! |
|
#2
|
||||
|
||||
|
Python is actually pretty efficent at converting tuples to lists and back again.. not to mention it being very easy!
I'm sure you've seen (if not used used) the str() type-cast function before, well same thing here with list().. >>> t = ('my', 'name', 'is', 'mr', 'tuple') >>> t ('my', 'name', 'is', 'mr', 'tuple') >>> l = list(t) >>> l ['my', 'name', 'is', 'mr', 'tuple'] >>> Mark |
|
#3
|
||||
|
||||
|
OK, thanks.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Convert a tuple to a list? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|