Converting a tuple to a list

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel Ibanez

    Converting a tuple to a list

    Hi all ..

    I'm trying to using the map function to convert a tuple to a list, without
    success.

    I would like to have a lonely line that performs the same as loop of the
    next script:

    -------------------------------------------
    # Conveting tuple -list

    tupla = ((1,2), (3,4), (5,6))

    print tupla

    lista = []
    for a in tupla:
    for b in a:
    lista.append(b)
    print lista
    -------------------------------------------

    Any idea ?

    Thanks ...

    # Gabriel

Working...