print list of tuples without brackets python
Question: I have a list of tuples and I want to print flattened form of this list. I
don't want to transform the list, just print it without parenthesis and
brackets.

    
    
    input: [ ("a", 1), ("b",2), ("c", 3)]
    output:   a 1 b 2 c 3
    

Here's what I do:

    
    
    l = [ ("a", 1), ("b",2), ("c", 3)]
    f = lambda x: " ".join(map(str,x))
    print " ".join(f(x) for x in l)
    

I'm interested in if anybody has a more elegant and possibly a more efficient
solution,possibly without doing join, only print. Thanks in advance.


Answer: 
    from __future__ import print_function 
    
    l =  [("a", 1), ("b",2), ("c", 3)]
    
    print(*(i for j in l for i in j))
    a 1 b 2 c 3
    

Or using itertools.chain to flatten:

    
    
    from itertools import chain
    
    print(*chain(*l))
    

