diff --git a/_posts/2016-04-19-python-permutations.markdown b/_posts/2016-04-19-python-permutations.markdown new file mode 100644 index 0000000000000000000000000000000000000000..10c81464708d3d22191ad84881220896013e2fc3 --- /dev/null +++ b/_posts/2016-04-19-python-permutations.markdown @@ -0,0 +1,22 @@ +--- +layout: post +title: "Python Permutations" +date: 2016-04-19 19:31:43 +0700 +categories: [python] +--- +This simply how to implement the module of permutations in python. + +{% highlight ruby %} +>>> 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 +>>> +{% endhighlight %} \ No newline at end of file