Min/max for itertools python
Question: Ok i got this code

    
    
    import itertools
    res = itertools.product('abc', repeat=3) 
    for i in res: 
        print ''.join(i)
    

The problem is i don't know how i can also add an minimum and maximum to the
word that's gonna be the output? So lets say i put in the letters `'a'`, `'b'`
and `'c'` but i only want a minimum 1 letter and maximum 2 letter word how
would i do that? I'd already search on the internet, but couldn't find
anything. It's meant to make a dictionary for brute-force. I'm a beginner at
hacking but not a script kiddie ya know.


Answer: Use itertools.permutations(). Then concatenate the results.

    
    
    S = [x for x in permutations('abc',2)] + [ x for x in permutations('abc',1)]
    

Actually you could also use `products`. The only difference is that products
removes duplicate results. But you won't have any duplicates when all the
elements are distinct.

