python join equivalent
Question: I have a dictionary say..

    
    
    dict = {
        'a' : 'b',
        'c' : 'd'
    }
    

In php I would to something like implode ( ',', $dict ) and get the output
'a,b,c,d' How do I do that in python?


Answer: This seems to be easiest way:

    
    
    >>> from itertools import chain
    >>> a = dict(a='b', c='d')
    >>> ','.join(chain(*a.items()))
    'a,b,c,d'
    

