adding each member of an array again, right after itself
Question: if I have this Python array:

    
    
    mac_tags = [ "global_rtgn", "global_mogn" ]
    

And I want this Python array:

    
    
    mac_tags = [ "global_rtgn", "global_rtgn", "global_mogn","global_mogn" ]
    

How might I create it programmatically?


Answer: 
    new_mac_tags = []
    for tag in mac_tags:
        new_mac_tags += [tag, tag]
    

or

    
    
    from itertools import chain, izip
    new_mac_tags = list(chain.from_iterable(izip(mac_tags, mac_tags)))
    

