David Zambrano

I am freelance I.T-Software developer; C#/.Net MVC-Core, Xamarin..

Navigation
 » Home
 » About Me
 » Projects
 » Github
 » XML Feed

Python Permutations

19 Apr 2016 » python

This simply how to implement the module of permutations in python.

>>> from itertools import permutations
>>> perms = [''.join(p)+"@gmail.com" for p in permutations('abc', 3)]
>>> for x in range(0, len(perms)):
...     print (perms[x])
... 
abc@gmail.com
acb@gmail.com
bac@gmail.com
bca@gmail.com
cab@gmail.com
cba@gmail.com
>>>