Created
January 23, 2016 11:28
-
-
Save avdata99/0e508142f9a69a566dda to your computer and use it in GitHub Desktop.
Testing itertools product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# combinaciones de lk - xcvb - op - ghjk | |
p0 = ['l', 'k'] | |
p1 = ['x', 'c', 'v', 'b'] | |
p2 = ['o', 'p'] | |
p3 = ['g','h','j','k'] | |
c = 0 | |
for l0 in p0: | |
for l1 in p1: | |
for l2 in p2: | |
for l3 in p3: | |
c += 1 | |
print '{} {}{}{}{}'.format(c, l0, l1, l2, l3) | |
import itertools | |
prod = itertools.product('lk', 'xcvb', 'op', 'ghjk') | |
c = 0 | |
for p in prod: | |
c += 1 | |
print '{} {}'.format(c, str(p)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment