mirror of
https://github.com/aljazceru/cryptoanarchywiki.github.io.git
synced 2025-12-17 05:04:21 +01:00
Add post
This commit is contained in:
22
_posts/2016-04-19-python-permutations.markdown
Normal file
22
_posts/2016-04-19-python-permutations.markdown
Normal file
@@ -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 %}
|
||||
Reference in New Issue
Block a user