Python permutation
Question: How would I accomplish the following in python:

    
    
    first = ['John', 'David', 'Sarah']
    last = ['Smith', 'Jones']
    
    combined = ['John Smith', 'John Jones', 'David Smith', 'David Jones', 'Sarah Smith', 'Sarah Jones']
    

Is there a method to combine all permutations?


Answer: [`itertools.product`](http://docs.python.org/library/itertools.html#itertools.product)

    
    
    import itertools
    combined = [f + ' ' + l for f, l in itertools.product(first, last)]
    

